Caching html pages - no thanks - but how?
-
Hi. This issue has bothered me for some time now. I have quite a normal website, with different html files. If I make changes to a file, I can (sometimes!) see the changes when I hit f5. But if the file is fully replaced (same name and extension though), my browser shows the previous cached page. So I have to manually right click in the frame, and reload it to see the new version of the page. After many times googling to address this issue, Ive come up with these meta tages in top of each page:
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<meta http-equiv='pragma' content='no-cache'>But little does it help. The problem is still there. Why? And how to solve it? I´ve inspected of other sites that updates several times a day. They have have no special meta tags or alike in their html pages. And it´s of course not nescasary to update the page manually. Is it a server side setting or what figures? Thanks alot for your time :)
-
Hi. This issue has bothered me for some time now. I have quite a normal website, with different html files. If I make changes to a file, I can (sometimes!) see the changes when I hit f5. But if the file is fully replaced (same name and extension though), my browser shows the previous cached page. So I have to manually right click in the frame, and reload it to see the new version of the page. After many times googling to address this issue, Ive come up with these meta tages in top of each page:
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<meta http-equiv='pragma' content='no-cache'>But little does it help. The problem is still there. Why? And how to solve it? I´ve inspected of other sites that updates several times a day. They have have no special meta tags or alike in their html pages. And it´s of course not nescasary to update the page manually. Is it a server side setting or what figures? Thanks alot for your time :)
This is not a serverside issue, cache control is arranged by the client. If the client suspects the content to be out of date the browser will sent a head request. The server then replies with status 200 if there is a new version. To disable caching on the browser you can set the following 2 headers:
Cache-Control: no-cache, must-revalidate Expires: Sat, 26 Jul 1997 05:00:00 GMT
This should disable browser cache. -
This is not a serverside issue, cache control is arranged by the client. If the client suspects the content to be out of date the browser will sent a head request. The server then replies with status 200 if there is a new version. To disable caching on the browser you can set the following 2 headers:
Cache-Control: no-cache, must-revalidate Expires: Sat, 26 Jul 1997 05:00:00 GMT
This should disable browser cache. -
That's correct.
-
That's correct.
-
That's correct.