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:
[html]
<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.
Requirements ¶
There are no special requirements. It was tested with Yii 1.1.7 and 1.1.8.
Usage ¶
Just expand Zip in your components directory (or any other) and append configuration:
'components'=>array(
...
'clientScript' => array(
'class'=>'CSClientScript',
'version'=>'1.0.3'
),
...
Great!
haven't tested yet, but it is something i'll use for sure in a near future!
regards!
Great Idea!
Man, I've run into this problem so many times. Thank you!
...
started using EClientScript and I think my extension will be abandoned. EClientScript provides same caching prevention on content change and also merging multiple js/css files into one... YSlow gives A+ ;)
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.