Link | pk_autoversion |
Author | Pier Kuipers |
Category | Utility |
Version | 8.5.x |
License | Public Domain |
Posted | 20 Feb 2012 |
Updated | 20 Feb 2012 |
More by this author... |
This tag is based on an idea posted on StackOverflow, on how to force-refresh CSS files: http://stackoverflow.com/questions/118884/what-is-an-elegant-way-to-force-browsers-to-reload-cached-css-js-files#118886 Requires rewrite rule in apache config as follows: RewriteRule ^(.*)\.[\d]{14}\.(css|js)$ $1.$2 [L]
[pk_autoversion('/css/screen.css')] -> '/css/screen.20120219213351.css'
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
/* ================================================================================ This tag is based on an idea posted on StackOverflow, on how to force-refresh CSS files: http://stackoverflow.com/questions/118884/what-is-an-elegant-way-to-force-browsers-to-reload-cached-css-js-files#118886 Requires rewrite rule in apache config as follows: RewriteRule ^(.*)\.[\d]{14}\.(css|js)$ $1.$2 [L] ================================================================================ */ if(!lasso_tagexists('pk_autoversion')); define_tag('autoversion', -namespace = 'pk_', -required='filename', -description='Changes a requested CSS or JS filename to include a datestamp string'); local('output'=string); local('versionstring' = (date(file_moddate(#filename))->format('%q'))); #output = string_replaceregexp(#filename, -find='^(.*)\.(css|js)', -replace='\\1.'#versionstring'.\\2'); return(@#output); /define_tag; /if;
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft