Zola Posted March 22, 2013 Share Posted March 22, 2013 (edited) Hi all I have a big global stylesheet for a website that I update quite regularly. One thing that bugs me is that once I update the CSS file and overwrite it, the site usually needs refreshed in the browser to see changes, or else things could appear out of sync. I did a little research on my problem and found these bits of code. From my understanding this code (placed at the very top of the document before the site loads), will tell the browser to ditch the memorised stylesheet and load it fresh. Is this correct? If so should I only have it in use on the index page now and again after a few big updates? header("Expires: Tue, 01 Jan 2000 00:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); Edited March 22, 2013 by Zola Quote Link to comment https://forums.phpfreaks.com/topic/276007-forcing-browser-to-reload-css-stylesheets-is-this-code-the-best-way/ Share on other sites More sharing options...
Zola Posted March 25, 2013 Author Share Posted March 25, 2013 Bump, any help appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/276007-forcing-browser-to-reload-css-stylesheets-is-this-code-the-best-way/#findComment-1420923 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.