Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add caching example

  • Loading branch information...
commit 3690ed3b7c233d41a5a9729d21a1db9811fcbeba 1 parent 5e13aa8
@rkh rkh authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 README.rdoc
View
15 README.rdoc
@@ -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:
Please sign in to comment.
Something went wrong with that request. Please try again.