Auto-Update Style (CSS) Sheets

If you’ve done enough style sheet work, you’ll now that eventually you’ll run across a situation where updating the CSS can really make a mess of your website for other users/visitors. This is because other browsers will likely have a cached value of your OLD css, so all the changes you make to your design will incorrectly use this old css and possibly muck up the layout of your site pretty badly.

To avoid this, some code should be added to force all browsers to re-cache upon a file change. This is standard in some other e-commerce platforms but, regrettably, missing in OXID. If you’d like to add this functionality, make the following change:

Open file ./core/smarty/plugins/function.oxstyle.php

Replace

$sStyle = $myConfig->getResourceUrl($sStyle);

with

// BEGIN MOD: adding timestamp as query string to force browser reload on changes
$sStyle = $myConfig->getResourceUrl($sStyle) . '?' . filemtime($myConfig->getResourcePath($sStyle));
// END MOD

I hope the OXID guys will eventually make something like this standard. I’ve heard this fix may not work on some obscure browsers, but I’ve also never seen a better fix.

Hi,

made a bug out of it. Thanks for this valuable information:
https://bugs.oxid-esales.com/view.php?id=3725

Unfortunately, this seems to be inside a smarty plugin, isn’t it. I reckon we’ll do not touch that “third party” stuff.

Regards

It’s one of the custom OXID smarty plug-ins (i.e. not part of the standard smarty package)

[QUOTE=spurvis;84598]It’s one of the custom OXID smarty plug-ins (i.e. not part of the standard smarty package)[/QUOTE]

Let’s see what the Bug-Queens make out of it :smiley:

Cheers