Skip to content

A Magento extension for adding version numbers to css and js files

License

Notifications You must be signed in to change notification settings

leytech/Leytech_CssJsVersion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSS/JS Cache Buster for Magento

This Magento extension allows you to automatically add a version number to CSS and JS files to help bust browser caches.

Unlike other similar extensions this extension does not rewrite the Mage_Page_Block_Html_Head block. This is crucially important as it means it has greater compatibility with many other extensions that already rewrite that same block.

Features

  • Helps bust browser caches by adding a defined query string to JS and CSS assets.
  • Uses no Model or Block rewrites! Does not rewrite the Mage_Page_Block_Html_Head block like other similar extensions.
  • Requires no additional web server configuration.
  • Admin setting to define the version to append.
  • Option to automatically set a new version when Magento cache is flushed or refreshed.
  • Clean code.

Compatibility

Tested on Magento CE 1.9.3.2. Should work on lower versions and equivalent EE. Almost certainly doesn't work with FPC.

How to use?

  1. Enable the extension under System -> Configuration -> Leytech Extensions.
  2. Enter the version number to append.
  3. Flush the cache.
  4. Repeat steps 2 and 3 when you make changes to JS and CSS assets and wish to force browsers to re-download them.

Screenshots

Without this extension:

No CSS/JS version

With this extension:

Appended CSS/JS version

To do

  1. Nothing really. Feature requests welcome.

Support

This extension is provided free of charge as-is. We don't provide free support.

Contribute

Pull requests and feedback welcome.