Plugins - CachedAssets

StarAdd to favorites

CachedAssets

Rails plugin to intended to help reduce the number of HTTP requests when loading static assets like stylesheets and JavaScript files.

Usage

Instead 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.

Istvan Hoka

http://code.google.com/p/cachedassets/

http://cachedassets.googlecode.com/svn/

Rails' (MIT)

  • Currently 3.6/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Assets

Tags

Comments

Add a comment
Sergey 9 Apr 2007

What is difference with build-in rails

javascriptincludetag :defaults, :cache => true

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?