Versioned URLs plugin

Plugin details

This plugin modifies Rails' existing asset timestamping mechanism to support
versioned urls, a-la "http://www.somehost.com/images/logo.gif.v423".

Websitehttp://blog.dannyburkes.com/2006/11/2/versioned-urls-for-rails/ Repositoryhttp://svn.lingr.com/plugins/versioned_urls/ Author dburkes Tags url, Version LicenseUnknown

Documentation

Install the plugin:
ruby script/plugin install http://svn.lingr.com/plugins/versioned_urls/

Moving the asset version information into the path (rather than in a parameter, like Rails' default "http://www.somehost.com/images/logo.gif?39487279348") makes it possible to force even more aggressive client-side caching of assets like images, stylesheets, javascripts, etc.

Add appropriate rewriting and cache-header-pushing configuration to your web servers, e.g., for lightty:

url.rewrite-once = ( "^/(.*\.(css|js|gif|png|jpg))\.v[0-9.]+$" => "/$1" )
expire.url = ( "/stylesheets/" => "access 10 years" ,
                    "/javascripts/" => "access 10 years",
                    "/images/" => "access 10 years"  )



NOTE
=====
This plugin can only be effective when combined with URL rewriting and expiration header pushing on your web server. If you use this plugin without adding the appropriate rewriting rules to your web server, none of your assets will serve correctly. If you use this plugin without adding the appropriate expiration header pushing to your web server, then the plugin won't be effective at improving browser caching behavior.

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (1 older version) | Last edited by: scott, 9 months ago