Permalink
Browse files

add caching example

  • Loading branch information...
1 parent 5e13aa8 commit 3690ed3b7c233d41a5a9729d21a1db9811fcbeba @rkh rkh committed Feb 21, 2011
Showing with 15 additions and 0 deletions.
  1. +15 −0 README.rdoc
View
@@ -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:

0 comments on commit 3690ed3

Please sign in to comment.