You are here: Browse Railsplugins Cachedassets
Rails plugin to intended to help reduce the number of HTTP requests when loading static assets like stylesheets and JavaScript files.
UsageInstead of using the default Rails helpers like <%= javascript_include_tag :defaults %> <%= stylesheet_link_tag ‘scaffold’ %>
use: <%= cached_javascript_include_tag :defaults %> <%= cached_stylesheet_link_tag ‘scaffold’ %>
The key here is to have as few of these statements as possible because the plugin will make a single asset from the list of sources.
So, if you might have something like: <%= javascript_include_tag :defaults %> <%= javascript_include_tag ‘lightbox’ %> <%= javascript_include_tag ‘yui/yahoo-min’, ‘yui/event-min’, ‘yui/treeview-min’ %>
then you want to combine them into a single statement, like so: <%= cached_javascript_include_tag :defaults, ‘lightbox’, ‘yui/yahoo-min’, ‘yui/event-min’, ‘yui/treeview-min’ %>
== Documentation
Not much to document. Take a look at the plugin rdoc.
NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly