This module adds a version to static content in order to avoid any issues by browser and CDN cache.
OverviewBack to top
This module provides the functionality required to add a version to static content in order to avoid any issues by browser and CDN cache. This is highly recommended for projects in development and a must-have for a live site which is working on new features every day. It's more powerful than other versioning modules because it's compatible with CDN configurations and also has the functionality to inject versions into the url path.
The module provides 2 types of versions:
- Query Param Version: This is the most basic and simple, it just adds a query param to the url with desired content.
- Url Rename Version: This powerful functionality provides a way to inject a version into the url.
Also you can choose source of version with this 2 options:
- Static Version: This is as simple as possible, you can define a version number for all your files, this allow you to force flush all the content version.
- Dynamic Version: This is more sophisticate and smart, it detects the last change date from each file and use it as version number, then you always will get the last version on frontend.
Static Version Module gives you the posibility to get a hash for versions in order to improve your security by hiding what information you are using as a version number, also for query string you can choose the parameter name for version string.
Once the module is installed you must set it up going to System -> Configuration -> Developer and set Enable to Yes.
Then, you will be able to setup the module in order to use it. By default it comes ready for use Query String version with an static version number, which will be hashed, and "v" as the query string param.
You will find most of the configurations with comments explaining his own functionality.
File Rename Configuration
You must know which Web Server are you using, the module support Apache and Nginx:
- Apache: You just needs to enable Mod Rewrite Module.
- Nginx: you must change your host configuration in order to allow automatic rewrites for version url section, to do this you should follow nginx.conf.sample file included with the module.
File Rename Testing
Before to set File Rename as version type and after follow File Rename Configuration step you can test file rename functionality doing this:
- Get the url to some JS which is part of core Magento, for ex. Prototype:
- Add an string "version123456" after "js" and try it on your browser
- If you get the same js file if you get it by common url, it's working fine.
You can also do same flow with some url from skin area in order to test both areas.
Release NotesBack to top
- Compatible with CE: 1.7 1.8 1.8.1 1.9 1.9.1 1.9.2 1.9.3
- Stability: Stable Build
- First stable version