Need Help stopping pages/images from being cached

D

Dan

Is there an effective way to stop pages from being cached?

I've created several websites that have dynamic content and images that are
managed by a client. The images are named according to the "id" generated
via an Identity column of their corresponding database record (ex:
1058.jpg). The problem occurs when the client tries to change the image.
The client gets understandly confused because the old image is still
displayed, due to the browser caching the image. How can I force the
browser to stop caching the page/image?

All of the ASP pages already have the following:

<%Response.Expires = -1%>
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">

Any ideas?

Thanks,
Dan
 
A

Alan Howard

I've always turned on Immediate Content Expiration (Web Site Properties ->
HTTP Headers) and used this in my ASPs:

Response.AddHeader "expires", "0"
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", "no-cache"

Seems to work.

Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top