tags:

views:

131

answers:

3

URL is here: http://www.thexsoft.com/DownloadFolder/download.php?file=P2PTransfer

This page is basically a way for me to have set url to download a certain problem i published. This page should never ever be cached, but it seems to be caching still.

I have set the following items:

<meta http-equiv="expires" content="0" >
<meta http-equiv="cache-control" content="no-cache" >
<meta http-equiv="pragma" content="no-cache" >
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" >

The html code on the page validates 100% when i don't have the fastclick.net ad code in, but i keept it in now because it normally is in.

+4  A: 

Pragma: no-cache prevents caching only when used over a secure connection (https). A Pragma: no-cache META tag is treated identically to Expires: -1 if used in a non-secure page. The page will be cached but marked as immediately expired.

http://support.microsoft.com/kb/234067

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
Emre
Does this trick works even for the CSS on the page?
DaNieL
I believe that you're incorrect about "pragma: no-cache" only preventing caching for HTTPS connections, unless you are talking about how some very specific version of some browser acts.
Eddie
@DaNiel CSS doesn't belong in the same place as the markup, especially when you're worried about caching issues.
apphacker
@Eddie this is how IE works. You can check it out here http://support.microsoft.com/kb/234067
Emre
+2  A: 

Yes, in some circumstances browsers cache aggressively, especially IE6. You need to check the http headers your server is sending, and if that isn't the issue try a cachebusting URL (insert a random/timebased get variable) to make the browser think it's a new URL.

apphacker
+2  A: 

I checked your headers using Firebug:

Cache-Control: max-age=1209600
Expires: Tue, 28 Apr 2009 18:49:15 GMT

In PHP you can send HTTP headers with header().

header('Pragma: no-cache');
header('Expires: -1');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
Ole J. Helgesen
I think you should use header('Cache-Control: no-cache');see this page http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Emre