views:

49

answers:

1

After I upload my PHP files to my web host, I view the page by the URL. So what I usually do as I work on the page is make a change, upload, then refresh the browser to view my changes.

What I find is that sometimes I refresh and it shows me a previous version of the page, I hit refresh 5 times and it shows me 5 different versions of the page some old changes some new changes, it makes it really difficult to know which is the latest version.

I dont think this is a local caching problem, Ive disabled caching in all browsers, the problem occurs in IE, FF, Chrome

I have a feeling it might be the web server. I believe the hosting company uses Zeus (?) web server product.

+1  A: 

Add to your PHP files

<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>

and for static HTML files

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
Pentium10