Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
Home | Profile | Register | Active Topics | Members | Search | FAQ
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site

 All Forums
 Advanced Tips and Tricks - NO QUESTIONS PLEASE
 Force CSS Update In Browser
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic   

Advanced Member

United Kingdom
269 Posts

Posted - 06/05/2019 :  05:59:44  
When changing some CSS in style.css, I wasn't seeing the updates on my web page when refreshed, even if I pressed Ctrl + F5. Using the code below forces the CSS to update when Ctrl +F5 is used to refresh.

<link rel="stylesheet" type="text/css" href="../css/style.css?ts=<?=time()?>" />



Using ECT since 2003.

ECT Moderator

4301 Posts

Posted - 08/03/2019 :  14:44:34  
That'a good cache busting idea for development, I do something similar. But a word of caution; you don't want that on your production site or you'll lose all the performance benefits of having your css cached on the first page load, forcing the browser to fetch the same css file over and over again, for every new page visit. For production you might just want to use a version number or some such like this
<link rel="stylesheet" href="css/style.css?v=99">
and just increment that number when you actually push changes to production.


Professional ecommerce web hosting services
Shared hosting Windows & Linux | Dedicated servers | Domains | SSL
Ecommerce Templates specialists since 2003
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2020
This page was generated in 0.02 seconds. Snitz Forums 2000