473,322 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Need Help stopping pages/images from being cached

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
---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.676 / Virus Database: 438 - Release Date: 5/3/2004
Jul 19 '05 #1
1 1725
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" <so*****@somewhere.com> wrote in message
news:uP**************@tk2msftngp13.phx.gbl...
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

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Norman Peelman | last post by:
I have a script that outputs images directly using the 'image' functions. I have googled quite a bit but cannot seem to find the correct method of sending headers to keep the images from being...
5
by: DaveB | last post by:
I have to come up to speed quickly on PHP since I have been given the responsibilty of updating our website. I have setup a local web server through IIS, downloaded and installed PHP. I'm using...
1
by: Harod Ruthgar | last post by:
var image = new Image(); image.src="pathToTheFile"; The above code is called 25 times (with different pathToTheFile) within a loop. I manually checked the cache directory and not all images...
3
by: Steve Kreis | last post by:
Somebody help. The bloggers are driving me nuts. They are direct linking to images on my site thus driving up my traffic to an artificially high level. What I would like to do is prevent them from...
0
by: Adrian Parker | last post by:
IE.. Tools -> Internet Options -> Settings Button -> Check for newer versions of stored pages = Never If a user changes thier settings to this, then pages are cached in IE. From what we've...
3
by: visu | last post by:
I am currently working on my personl website a completely DB driven web application. in that i ve updating the images thru my admin panel .. but i am getting the old images not the update one when...
3
by: Dave | last post by:
I have an ASP 3.0 website on which the images are displaying intermittently. In other words, when I request a page, the image is blank. There is no missing image place marker (rectangle with a...
3
by: salmobytes | last post by:
Every img tag (<img src="xxx.jpg">) in the html source represents a separate GET roundtrip between client and server, no? What about background images in css? I'm starting to see more and more...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.