Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Need Help stopping pages/images from being cached

Reply
Thread Tools

Need Help stopping pages/images from being cached

 
 
Dan
Guest
Posts: n/a
 
      05-04-2004
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


---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.676 / Virus Database: 438 - Release Date: 5/3/2004


 
Reply With Quote
 
 
 
 
Alan Howard
Guest
Posts: n/a
 
      05-05-2004
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

"Dan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
> ---
>
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.676 / Virus Database: 438 - Release Date: 5/3/2004
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
applets being cached? yawnmoth Java 5 08-15-2006 07:40 PM
Stopping pages from being cached. Adrian Parker ASP .Net 0 03-18-2005 04:32 PM
how can I tell if dropdownlist is really being cached? Hazz ASP .Net 1 03-17-2005 09:01 AM
my cached dataset just wont stay cached!! Craig G ASP .Net 0 03-07-2005 10:02 AM
How to prevent aspx page from being cached by user's browser? feng ASP .Net 3 02-08-2004 09:31 AM



Advertisments