Fresh Page Reload

Graeme1

Thread Starter
Joined
Jul 18, 2006
Messages
134
Hello All,
What is the best code to put at the top of a web page to ensure the page is fresh & not from the Cache, I may have asked this before, thank you as always,
Graeme
 

Graeme1

Thread Starter
Joined
Jul 18, 2006
Messages
134
Thank you,
If I use
Standard Cache-Control directives that can be used by the client in an HTTP request.
Cache-Control: max-age=<seconds>
Cache-Control: max-stale[=<seconds>]
Cache-Control: min-fresh=<seconds>
Cache-Control: no-cache
Cache-Control: no-store
Cache-Control: no-transform
Cache-Control: only-if-cached
how many seconds to I need to add as in <seconds>?
 

Graeme1

Thread Starter
Joined
Jul 18, 2006
Messages
134
If day I put 90 seconds in each, does that mean if I view the page, it will refresh after 90 seconds while I am viewing it? Thank you
 

Graeme1

Thread Starter
Joined
Jul 18, 2006
Messages
134
Thank you very much for this, do I just put that single line of code in as you typed it?
 
Joined
Mar 30, 2014
Messages
4,766
For that one little control, yes, you can use it as is. However, there is a lot more to it. See the above links.
 

Graeme1

Thread Starter
Joined
Jul 18, 2006
Messages
134
Where in the HTML code does Cache-Control: max-age=900, must-revalidate please?
 
Joined
Mar 30, 2014
Messages
4,766
It's in the mnot.net page I linked you to above:

www.mnot.net/cache_docs/ - Caching Tutorial - for Web Authors and Webmasters
HTTP headers are sent by the server before the HTML, and only seen by the browser and any intermediate caches. Typical HTTP 1.1 response headers might look like this:

HTTP/1.1 200 OK
Date: Fri, 30 Oct 1998 13:19:41 GMT
Server: Apache/1.3.3 (Unix)
Cache-Control: max-age=3600, must-revalidate
Expires: Fri, 30 Oct 1998 14:19:41 GMT
Last-Modified: Mon, 29 Jun 1998 02:28:12 GMT
ETag: "3e86-410-3596fbbc"
Content-Length: 1040
Content-Type: text/html​

The HTML would follow these headers, separated by a blank line. See the Implementation sections for information about how to set HTTP headers.

...
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top