Send Cached plugin

Plugin details

send_cached makes it easier to use decide when to send a 304 response with send_data and send_file.

Websitehttp://wiki.pluginaweek.org/Send_cached Repositoryhttp://svn.pluginaweek.org/trunk/send_cached Author Aaron Pfeifer Tags Cache LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://svn.pluginaweek.org/trunk/send_cached

send_data
=============

To send data for models with an updated_at field:

  send_data(record, :cache => true)


To send data for models without an updated_at filed:

  send_data(record, :cache => true, :last_modified => record.modifications.last.created_at)


send_file
=============

To send a file with cache checking enabled:

  send_file(file_path, :cache => true)


Note that :last_modified does not have to be specified since it can be determined based on the file path.

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (2 older versions) | Last edited by: obrie572, about 5 hours ago