I have a scenario where I have a central file management interface which handles security and the serving of files such as images, pdf documents and the like.
When a user accesses this say as the target of an image, it validates the security for that user and then returns the file, bytes, etc.
What I'd like to do is tell the client once they have validated the first time to cache the content on their machine so that they don't have to keep hitting my server to know if the item is there/pull down a new copy each time. How do I do this in my code behind so that the item is cached only when a user has been successfully validated to access the content? Ideally I'd like the page to return a 304 message or the client to simply pull it from their local cache.
Also i'm using Response.TransmitFile
, will this invalidate the caching paramenters such as Response.Cache.SetExpires(Date.Now.AddMinutes(10))
?