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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browser Cache - Still having problems 2

Status
Not open for further replies.

datamasher

Technical User
Dec 31, 2001
69
GB
Hi again,
I thought everything was ok after Feherke kindly responded to my previous thread on this subject.
However it seems that pages are still being cached when using Firefox.

As stated in previous thread I've included the following meta tags in the head of the html pages that I don't want the browser to cache :-

<meta http-equiv="Expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-control" content="no-cache">

The pages are XHTML 1.0 Transitional html if this has any bearing on the problem.

The site involved is Link

Am I missing something?

Steve
datamasher
 
Hi

I already formulated a question about why using [tt]meta[/tt] tags and not sending HTTP response headers, but then I removed the question as it seemed off-topic in the HTML forum. But now I feel I really have to ask it : why ? I see that documents have .html extension, but the source contains dangling indentations, typical for generated content. So are those indeed static documents, or dynamically generated ?

First of all, I would make sure there is no syntax error in the involved tags :
Code:
<meta http-equiv="Cache-control" content="no-cache"[COLOR=red yellow]/[/color]>


Feherke.
feherke.ga
 
Hi Feherke,
The documents are indeed static. I will look into the syntax though as you may be right that I have included backslashes where I shouldn't have.
Many thanks again for your help. I will have another look at it and will reply with my findings

Steve
datamasher
 
Hi

Steve said:
you may be right that I have included backslashes where I shouldn't have.
No, the other way : you missed a slash where should be one. [tt]meta[/tt] tags have no closing pairs, so in XHTML you have to add the self closing slash in front of their closing greater-than sign.

But even with that minor syntax issue, I was unable to reproduce the problem locally. I use Apache, but I find no relevant difference between the HTTP headers. :-(

You can try to add more items to the [tt]Cache-Control[/tt] header to enforce the already imposed restriction :
[tt]Cache-Control: no-cache, no-store, max-age=0, must-revalidate[/tt]

Or even more, with Explorer 5-specific things, but this sounds like voodoo to me :
[tt]Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0[/tt]


Feherke.
feherke.ga
 
The HTTP/1.1 cache control headers were really intended for caching servers rather than browsers, so while browsers do read such directives they are not necessarily 'obliged' to respond to them.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Hi Feherke and Chris,
Thanks for your help and advice Feherke and the heads up Chris about browsers not being obliged to adhere to the headers.

I've included the following in the head of my html pages :-

Code:
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />

and this appears to work in all of the latest versions of the following browsers :-
Firefox, IE, Opera, Chrome and Safari for windows

Many thanks to you guys

Steve
datamasher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top