Solved

Force the ISP to Re-load Pages

Posted on 2004-08-11
13
327 Views
Last Modified: 2010-04-06
Hello,

Thanks so much for reading our question.  In our part of the world, the ISPs often do not check for new pages each time someone comes to our site, relying instead on a cache of the site's content.  We have one page the we would like to always be pulled freshly from the server.  Is there any code we can add to the page to make the latest version of the page appear?  To ovveride the cache, and pull the latest data each time someone visits the page.  Open to all solutions, frames- wise and others, just so want to have people see that page in real-time.  

Many thanks,

Yunkaa
0
Comment
Question by:yunkaa
  • 5
  • 4
  • 3
  • +1
13 Comments
 
LVL 33

Accepted Solution

by:
sajuks earned 400 total points
Comment Utility
<HTML>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD>
<BODY>

Your other text
</BODY>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD>
</HTML>

Basically you repeat the meta tags both in the head and at the end of the page.


If its an ASP page, you can've this at the top
<% Response.CacheControl = "no-cache" %>
<% Response.AddHeader "Pragma", "no-cache" %>
<% Response.Expires = -1 %>
0
 
LVL 33

Expert Comment

by:sajuks
Comment Utility
php, you can've this at the top
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    
header ("Cache-Control: no-cache, must-revalidate");  
header ("Pragma: no-cache");
0
 

Author Comment

by:yunkaa
Comment Utility
Hello Sajuks

Thanks SO MUCH for answering our question!!  Please could you give us a little background on these tags?  What does this one do:  <META HTTP-EQUIV="Expires" CONTENT="-1">  Ours is just a straight HTML page.

Many thanks,

Yunkaa
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
I don't think you can overcome the ISP caching strategy without access to their server configuration.  It does not matter what is coded in the page to prevent caching if the ISP has configured the server always cache.

Cd&
0
 

Author Comment

by:yunkaa
Comment Utility
Hello CD!!

Thank you very much for responding to a question!!  What the sites like CNN.com and other news sites do in this situation?  So if the ISP is cache-ing would people see old news?  Do they use meta tags?  

Many thanks,

Yunkaa

0
 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 100 total points
Comment Utility
No one can really do much about it except complain.  The ISPs cache the pages to save bandwidth, and improve response time  They cache the pages on there own servers then when a user makes a page request, if they have an unexpired page in cache they return that instead of routing out across to the requested site.

Most of the time that is beneficial to the user.  The better ISP are selective about which sites they cache, and some will respect the caching indicated on the page, but no caching would mean they have to buy more bandwidth to maintain response time, so it is an issue that effects their profitability.

Cd&
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:yunkaa
Comment Utility
Hello CD!

Thanks so much for answering!!  Does the "no-cache" tag work?  If it doesn't keep pages from being cached, what does it do?

Many thanks x 1,000...

Yunkaa
0
 
LVL 33

Expert Comment

by:sajuks
Comment Utility
AS CD has rightly remarked, "No one can really do much about it except complain.".

If your ISP is among the better ones then the meta tags will work.

<META HTTP-EQUIV="Expires" CONTENT="-1"> :--->
That sets an immediate expiration on the file.

Prior to IE5 , the tag <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> used to suffice, but due to bugs
the tag <META HTTP-EQUIV="Expires" CONTENT="-1"> also starte being used.
0
 
LVL 33

Expert Comment

by:sajuks
Comment Utility
CNN uses  a meta tag
<meta http-equiv="refresh" content="1800">
which ensures thats the pages gets reloaded every 30 minutes (1800 seconds)

0
 

Author Comment

by:yunkaa
Comment Utility
Hello CD And Sajuks!

Does the meta tag work?  If an ISP is cache-ing, will this make it not cache the particular page?

Many thanks x 10,000...

Yunkaa
0
 
LVL 1

Expert Comment

by:lth2h
Comment Utility
Other than the meta tags, I'd suggest finding an ISP isn't broken.  If you're paying this ISP there is no excuse for what they're doing.  
0
 

Author Comment

by:yunkaa
Comment Utility
Hello Sajuks and CD   >>>

 THANK YOU FOR TAKING THE TIME TO PROVIDE THE WONDERFUL CODE, RESEARCH AND ADVICE! :))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

Yunkaa
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
The meta tags are for the browser.  Good ISP who are caching will respect the meta tags, but there is nothing that compels them to.

Glad we could help.  Thanks for the A.

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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

763 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

12 Experts available now in Live!

Get 1:1 Help Now