Thursday, April 8, 2010

caching issues - how to overcome? - PowWeb Community Forums

Oh my god.. for the last 4 hours I have been pulling my hair out (whats left of it) with .css caching problems on a site I am designing.

The problem was that no matter what changes I made to the css sheet it wasn't updating on the website. I tried deleting the css file on the server but it still loaded in the browser. I deleted browser history and still no luck.

Error turned out to be on my powweb webhost which had carried out upgrades to the server which included changes to caching so that there is now a 4 hour cache on files, powweb offer a solution in their knowledgebase of renaming files.

There are two solutions which may or may not work for you.
1. Hold "Ctrl & press F5" this will cause hard refresh on your browser.
2. In your HTML file in the "HEAD" Add "?version=1" to the end of your css file name eg link rel="stylesheet" type="text/css" href="css/style.css?version=1"

I spoke to Powweb live support & they gave me this bit of code to insert in the base of my .htaccess file.

<Files *>
Header set Cache-Control: "private, pre-check=0, post-check=0, max-age=0"


Header set Expires: 0


Header set Pragma: no-cache
</Files>



Source:
caching issues - how to overcome? - PowWeb Community Forums


No comments:

Post a Comment