Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force page reload and/or block page caching.

HTML: How To...

Force page reload and/or block page caching.

by  MikeBarone  Posted    (Edited  )
There are a couple of ways to make sure the users see the latest content on your web pages. Refresh the pages at certain time intervals or block the browser from caching the web page, each time they return they will load the data fresh.

=====
Do not allow the user to store the data in cache at all:

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">

Add this between the <head> and </head> tag and the page will never be cashed in the first place.

=====
Refresh the page after a certain time interval:

<meta HTTP-EQUIV="Refresh" CONTENT=300>

Add this between the <head> and </head> tag and the page will never be cashed in the first place.

Adding this tag will refresh the browser after 300 milliseconds. Change the number 300 to whatever you want.

This works well for pages that people will call up and stay on for long periods of time, if the content is updated frequently this will force a reload so they can see the content.

Word of warning, if you have a form on this page it will clear all the fields, users dislike that tremendously. I found that out the hard way.

Hope this helps.

+ + + + + +
Mike Barone
www.cgiscript.net
FREE and Pro CGI/Perl Scripts

FREE Scripts
www.cgiscript.net/scripts.htm
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top