Sometimes after making changes to the website design it is required that users’ browsers would update and refresh the theme files. To solve this issue it is possible to implement the versioning of static files. For instance, one can add a parameter with the theme version number.
So what we need to do is to add the parameter specifying the version number.
We have: http://test.com/js/prototype/prototype.js
It will become: http://test.com/js/prototype/prototype.js?ver=2
To do this, we need to override Mage_Page_Block_Html_Head and change the method of forming addresses of theme static files:
Partner With Us
Let's discuss how to grow your business. Get a Free Quote.
Talk to Vlad
1 2 3 4 5 6 7 8 9 10 11 12 |
…. if ($mergedUrl) { //BelVG Start if(Mage::helper('staticversion')->isEnabled()) { $mergedUrl .= '?ver=' . Mage::helper('staticversion')->getVersion(); } //BelVG End $html .= sprintf($format, $mergedUrl, $params); } else { foreach ($rows as $src) { //BelVG Start if(Mage::helper('staticversion')->isEnabled()) { $src .= '?ver=' . Mage::helper('staticversion')->getVersion(); } //BelVG End $html .= sprintf($format, $src, $params); } } …. |
Partner With Us
Looking for a partner that will help you to grow your business? We are the right company to develop your webstore. Feel free to get in touch with us. We will be happy to discuss your business opportunities and provide you with a Free Quote.
Talk to Vlad