csclientscript Component that appends version to every JS/CSS link

  1. Requirements
  2. Usage

When you are using "expires" headers with long in the future times, there can be problem with deploying changes, as some users can still be using cached CSS and JS files. You can change the name of such files every time, but this breaks code versioning.

Another solution provided by this extension is to append version (any string identifying version) as GET parametr to resources links, like:

<link rel="stylesheet" type="text/css" href="/css/site.css?v=1.0.1" /> 

then, after any change, you just increment version, and every browser will treat such link as new one and fetch file content.


There are no special requirements. It was tested with Yii 1.1.7 and 1.1.8.


Just expand Zip in your components directory (or any other) and append configuration:

  'clientScript' => array(
8 0
Yii Version: 1.1
License: BSD-2-Clause
Category: Caching
Developed by: Maciej Liżewski
Created on: Jul 7, 2011
Last updated: 12 years ago


show all