Skip to content

Commit

Permalink
add caching example
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh committed Feb 21, 2011
1 parent 5e13aa8 commit 3690ed3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.rdoc
Expand Up @@ -1000,6 +1000,21 @@ It is also possible to use a

etag @article.sha1, :weak

These helpers will not do any caching for you, but rather feed the necessary
information to your cache. If you are looking for a quick caching solutions, try
{rack-cache}[http://rtomayko.github.com/rack-cache/]:

require "rack/cache"
require "sinatra"

use Rack::Cache

get '/' do
cache_control :public, :max_age => 36000
sleep 5
"hello"
end

=== Sending Files

For sending files, you can use the <tt>send_file</tt> helper method:
Expand Down

0 comments on commit 3690ed3

Please sign in to comment.