I try to solve a problem with the behavior of VFS.
In AppHost in our self hosted windows service I have created a FileSystemVirtualPathProvider
base.VirtualFileSources = new FileSystemVirtualPathProvider(this,"~/…/FileSystem".MapHostAbsolutePath());
There is a file service , exactly as your new example with [Route("/GetFile/Locations/{LotNumber}/{ImagesPath}/{FileName}")]
and a GlobalRequestFilter to check the session, using the X-ss-id header.
The problem is that when I call the service URL the request is checked very fast from the GlobalRequestFilter (only the X-ss-Id ), but the performance of download through the service is slow.
In the opposite , if I call directly only the relative path
serviceURL + /Locations/{LotNumber}/{ImagesPath}/{FileName}
the FileSystemVirtualPathProvider downloads the image very fast.
As we use it , in this case, for the rendering of Razor pages , this performance is acceptable and fast.
but I don’t have security.
My question is the following
Is there a way in the FileSystemVirtualPathProvider to check the request’s header
if it is a valid session, as I do in the GlobalRequestFilter, but without to call actually the file service,
in order to get the superior performance?
thanks