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



Find us on Facebook

Follow us on Twitter

View our YouTube channel


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

PieMan
Advanced Member

United Kingdom
264 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()?>" />

Regards

Mike

Using ECT since 2003.

insight
ECT Moderator

USA
4193 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.

Peter


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