Have you ever had a client telling you he does not see the latest changes you have just deployed on his website? And you answer him to clear his browser cache? Well here is a Magento module that allows you to force static files reloading in the end-user’s browser, thanks to a variable that will be added to the HTTP request and that you can manage in admin panel.
Overview
Here is an overview of the Magento admin panel once the module is installed and enabled:
Features
Module adds a query parameter to each call of static file (js and css) that have been merged or not.
URL will look like this:
http://www.mystore.com/skin/frontend/default/mystore/css/styles.css?q=123456
UPDATE 2013-03-16: added auto generation feature based on last modification date (enabled by default).
Installation
Extension is available on GitHub: https://github.com/jreinke/magento-suffix-static-files
You have 2 ways to install it:
- Manual installation: download package here, unzip in Magento root folder, then clean cache.
- Installation with modgit:
modgit -e README.md clone queryfier https://github.com/jreinke/magento-suffix-static-files.git
See a full example of how to use
modgit
here.
Usage
Whenever you change the variable value, the file will be downloaded to the user’s browser and will be updated.
20 Responses to “Magento: A module to force static files reloading”
simple and use full thx
Awesome module! Here’s an idea, why not auto-generate the query parameter based on last modified date?
Thanks nice idea and this is done in master branch.
YEESSS man! Perfect idea!
Every time I do it manually and now it’s over.
Thanks, don’t stop posting.
Why dont you upload this in magento extension, let me know if you dont want to do that, i can put it magento extension, then it will be easy for people to install it.
Sorry Magento Connect workflow is painful, I don’t publish my modules on it anymore.
hi, does it work in 1.5?
I don’t know it’s not tested on this version. Try out and tell me if it’s not compatible.
Hello Johann,
I had installed it on my this version Magento ver. 1.5.1.0 How i know that is it working or not. means as output how it will work
If wrote also an Extension like these.
so you can take a look at these:
https://github.com/mklooss/Loewenstark_Head
Très bonne idée, je cherchais justement à palier le problème qui se posait à moi niveau cache suite à mes modifications incessantes !
J’ai par contre une 404 quand je passe par l’admin / config / bubblecode suite à l’installation en manuel.
Je n’ai jamais utilisé modgit, je vais donc m’y essayer voir si j’ai toujours le même problème
La 404 doit être un problème d’ACL une fois le module installé, il faut te déconnecter puis te reconnecter et ça devrait fonctionner
C’était exactement ça !
Merci beaucoup et bonne continuation
Bonjour, j’ai testé l’extension en local et cela fonctionne par contre une fois sur le serveur cela ne fonctionne plus, avez vous eu déjà ce cas ?
Merci par avance.
This extension does a rewrite on the html_head block so if you have another extension that does this (e.g. Fooman Speedster) then this extension won’t work if it “runs” after that other extension. Just something to be aware of.
Great job!
Another really simple, but really effective module! I found your customer login one this morning – great work.
I tried installing this module manually, but after exiting the admin panel, I was getting “Fatal error: Class ‘Bubble_Queryfier_Helper_Data’ not found in /home/dev/public_html/app/Mage.php on line 546″
I have my cache magement currently disabled, as well as compilation disabled, and merge css files disabled, but problem persists.
Ideas?
This is after downloading the file from:
https://github.com/jreinke/magento-suffix-static-files/archive/master.zip
Hi,
Is this module also work the JS & CSS compilation ?
works great! thank you!
If you want this to work in the admin as well check this SO post out:
http://magento.stackexchange.com/a/5956/32655
Is there a way to also clear .html files from cache?