asp.net mvc - how do i cache FileContentResult for performance? -


At the moment I have the following action to return files (images, PDFs, etc.) from my DB:

< Pre> // / GET: / FileManager / GetFile / ID [Output Cache (duration = 600, VaryByParam = "ID")] Public Received GetFile (Int ID) {FileService svc = New FileService (New SqlFileRepository (base. ConnectionString)); KsisOnline.Data.File Results = svc.GetFileByID (ID); Return file (results; data, results. Time, result. Upload file name); }

I am using the output cache attribute but I do not know how I am using it correctly or for this purpose Customize

As the code, I get the cache functionality in Firefox (3), but not IE (7) For some reasons IE is requesting an image from DB every time (which is bad that is clearly bad) and I do not know how to fix it. Not sure that IE does not support the standards properly, but I'm still not following some favorite caching conventions. I really appreciate some help with this, so I get a cross browser support at least DB hit and caching.

Edit: See Browsers / Tools, to view the above code in action or view it as a profile itself.

You have to use to see what HTTP header sent by IE is that your application has Firefox How to do it separately What you have to do is send the header to the browser if-modified-from header (and possibly an itg ) and your app with the HTTP 302 status Should answer.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -