Classic ASP pages Caching

Posted on 2011-03-10
Last Modified: 2012-05-11
Hello Experts,

I am having a problem where I think my pages are caching.

For example, I look at one page, navigate to another, then change the image in the file forlder and navigate to the first page. The original image is shown until I hit Refresh.

I have tried but  it did not work,

Secondly, I deleted the code from the previous URL and tried;en-us;332075 then restarted my machine and opened the same page where the old images appeared until I hit Refresh. Again, this was after restarting my machine, which contains both my IIS and my IE8.

Any ideas?
Question by:APD_Toronto
  • 4
  • 3
  • 3
LVL 28

Expert Comment

ID: 35102327
Just to understand you, are you trying to avoid users from going back to view a page *after* they have left that page?

Author Comment

ID: 35102608
no, my goal is to prevent the page from cachiing.

When the user returns to the page, I want them to see the newest/freshest data.

LVL 28

Expert Comment

ID: 35102689
Did you try disabling buffering?

Something like this:

   Response.Buffer = False
   Response.AddHeader "pragma","no-cache"
   Response.CacheControl = "no-cache"
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

LVL 28

Expert Comment

ID: 35102899
Try these as well:

    pStr = "private, no-cache, must-revalidate"
    Response.ExpiresAbsolute = #2000-01-01#
    Response.AddHeader "pragma", "no-cache"
    Response.AddHeader "cache-control", pStr

    If you find that you're still getting the old page, after clearing your browser's page and even deleting the file from the server, then IIS has it cached. You can clear this by going into the IIS Admin interface and unchecking "Cache ISAPI Applications", hitting apply, uploading the new file, and turning the setting back on.

Author Comment

ID: 35102957
I tried your first 3 lines.

Should I delete those, and try your other 4, or should i try all 7 lines?
LVL 28

Expert Comment

ID: 35104038
delete and try these new lines but before you do, please add this line and try again.

Response.Expires = -1


Accepted Solution

Abiel de Groot earned 500 total points
ID: 35106197
No of those will work as this is likely to be server caching.

Your best solution is a bit more basic, and insure the image url 'seems' different each time.

Try doing this to the image source...


<img src="yourImageFolder/yourImageName?<%=Now%> alt="<%=ArrShortCont(0,k)%>" border="0" class="Col_2b_IMG"/>


?<%=Now%> at the end of the image source ensures it is always different but will not affect the calling of the image.

Beest regards


Expert Comment

by:Abiel de Groot
ID: 35106200

Sorry... that should be:




Author Closing Comment

ID: 35109964
simple and awesome!


Expert Comment

by:Abiel de Groot
ID: 35110714
You are welcome.

The solution often is.

Best regards


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
File upload fails with SSL Certificate 3 42
Validating Date Part2 2 25
IIS 8.0 and Kemp Load Master 1 19
Read text on Table 7 25
Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit If you want to manage em…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question