Dirty Butter Posted March 6, 2017 Share Posted March 6, 2017 3 hours ago, bsandall said: To force your customers' browsers to refresh the CSS, you can do this simple trick: Open the /skins/foundation/templates/main.php file (or the equivalent for your skin) Find the <head> link to 'cubecart.css' Add '?v=1' to that link. In the end it should look like this: <link href="{$STORE_URL}/skins/{$SKIN_FOLDER}/css/cubecart.css?v=1" rel="stylesheet"> Whenever you make a major change to your CSS that will cause the store to look crappy for customers if they have a cached version, change the v=1 to v=1.1 or whatever. GOOD TO KNOW! Quote Link to comment Share on other sites More sharing options...
bsandall Posted March 8, 2017 Share Posted March 8, 2017 Note that JavaScript is also cached and, with the changes that have been / are being made to the way images display, it can negatively impact the customer experience. You can apply the same trick to JS files, notably in main.php toward the bottom, you'll find: {foreach from=$JS_SCRIPTS key=k item=script} <script src="{$STORE_URL}/{$script|replace:'\\':'/'}" type="text/javascript"></script> {/foreach} Add the same thing '?v=1' to that so it looks like: {foreach from=$JS_SCRIPTS key=k item=script} <script src="{$STORE_URL}/{$script|replace:'\\':'/'}?v=1" type="text/javascript"></script> {/foreach} Note that according to some answers on StackOverflow, adding this query parameter will not negatively impact the browser's ability to cache the file, it will just force it to refresh any time the parameter changes. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 8, 2017 Author Share Posted March 8, 2017 Thanks! Quote Link to comment 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.