Solved

Classic ASP pages Caching

Posted on 2011-03-10
10
463 Views
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 http://www.devx.com/vb2themax/Tip/18635 but  it did not work,

Secondly, I deleted the code from the previous URL and tried http://support.microsoft.com/default.aspx?scid=kb;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?
0
Comment
Question by:APD_Toronto
  • 4
  • 3
  • 3
10 Comments
 
LVL 28

Expert Comment

by:sammySeltzer
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?
0
 

Author Comment

by:APD_Toronto
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.

0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 35102689
Did you try disabling buffering?

Something like this:


   Response.Buffer = False
   Response.AddHeader "pragma","no-cache"
   Response.CacheControl = "no-cache"
0
 
LVL 28

Expert Comment

by:sammySeltzer
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
   
   

http://classicasp.aspfaq.com/general/how-do-i-prevent-my-asp-pages-from-caching.html

http://www.developerfusion.com/code/1160/preventing-caching/
   

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

Author Comment

by:APD_Toronto
ID: 35102957
I tried your first 3 lines.

Should I delete those, and try your other 4, or should i try all 7 lines?
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 28

Expert Comment

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

Response.Expires = -1

0
 
LVL 5

Accepted Solution

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

A:
0
 
LVL 5

Expert Comment

by:Abiel de Groot
ID: 35106200


Sorry... that should be:

?<%=Now()%>

Not

?<%=Now%>
0
 

Author Closing Comment

by:APD_Toronto
ID: 35109964
simple and awesome!

thanks
0
 
LVL 5

Expert Comment

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

The solution often is.

Best regards

A.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now