Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > Preventing caching of pages and referenced graphics
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 24th April 21:18
ron crawford
External User
 
Posts: 1
Default Preventing caching of pages and referenced graphics



My application, found at http://www.helpuplan.com, has one page
in which it is imperitive that the principle graphic
(a .gif file) is never taken from cache. I am currently
following Microsoft's recommended procedure for this
situation (Response.CacheControl="no-cache", etc.). This
apparently works most of the time, but seems to be
imperfect. Suggestions? Thanks.
  Reply With Quote


  sponsored links


2 4th May 05:12
michmo
External User
 
Posts: 1
Default Preventing caching of pages and referenced graphics



Hi Ron,

Please try the following and post back to let me know if it solved your
problem. My answer is in two parts.

Part 1)
Are you using Response.BinaryWrite to stream out your graphic? In that
case, try adding these to the stream.

<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1000000
%>

1) CacheControl tells all "modern" devices to not cache.
2) Expires tells all "modern" devices that the content is out-of-date (so
don't cache it).
3) Pragma tells many older devices to not cache.

"Devices" includes your server, the end user's browser, and any routers
inbetween.

PART 2)
If you have a tag in your page which points to the graphic, then you want
to set these headers for the graphic itself. This is done with IIS settings
using Internet Services Manager. In properties for the image file, on the
HTTP Headers tab, add the above headers manually.

--
Again, please let me know if this solves your problem.

Thank you, Mike Moore
Microsoft, ASP.NET

This posting is provided "AS IS", with no warranties, and confers no rights.


--------------------

microsoft.public.windows.inetexplorer.ie5.gen.disc ussion:8286
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666