1

How do you cache an aspx page call on the client?

The aspx page returns an asset and looks like this:

http://srv-edu-build/edumatic3/dev/RetrieveBlob.aspx?assetId=31809&assetFileId=9823

We have tried with Output Cache, with caching in the code behind, but the only result we get is server side caching (by IIS7).

In the header of the response cache-control is set to public and expiration time is set (to 14800 as set in output cache profile).

Lieven Cardoen
  • 25,140
  • 52
  • 153
  • 244
  • I have a similar problem - aspx pages that return dynamically generated images. The server caches and doesn't re-execute the page, but it returns the content again (the full file rather than a 304 status) and the browser doesn't seem to cache it at all. – Keith Jun 08 '10 at 09:18

1 Answers1

0

I think I've found why this happens it's a bug in IE.

IE can't cache if the Vary:* HTTP response header is used, but IIS returns it by default because it's in the HTTP 1.1 spec.

Try adding the following to your web.config:

<system.web> 
    <caching>
        <outputCache omitVaryStar="true" />
    </caching>
</system.web> 
Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Keith
  • 150,284
  • 78
  • 298
  • 434