Sha256: 76a83e51b8e115d361302dabb0cce5874104c9120d92ac5014d594d8419e886a
Contents?: true
Size: 1.35 KB
Versions: 5
Compression:
Stored size: 1.35 KB
Contents
= cacheability A gem that makes client-side caching of HTTP requests a no-brainer. It is built upon the Rack:Cache gem from Ryan Tomayko. Cached data can be stored in heap, file or memcached. See the Rack::Cache documentation (http://tomayko.com/src/rack-cache/) for more information. = Installation gem install cacheability = Usage require 'cacheability/restclient' RestClient.log = 'stdout' # displays requests and status codes resource = RestClient::CacheableResource.new( 'http://some/cacheable/resource', :cache => { :metastore => 'file:/tmp/cache/meta', :entitystore => 'file:/tmp/cache/body' } ) resource.get # get from remote server, and cache if possible # ... resource.get # get from cache, if still fresh. # ... resource.get(:cache_control => 'no-cache') # explicitly tells to bypass the cache, requires rack-cache >= 0.4 # ... Do yourself a favor and read: * the HTTP specification related to HTTP caching - http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html * Things Caches Do - http://tomayko.com/writings/things-caches-do = Supported libraries * rest-client > 0.9 = Dependencies * rack-cache = COPYRIGHT Copyright (c) 2008 Cyril Rohr. See LICENSE for details.
Version data entries
5 entries across 5 versions & 2 rubygems
Version | Path |
---|---|
cryx-cacheability-1.2.1 | README |
cryx-cacheability-1.2.2 | README |
cacheability-1.2.0 | README |
cacheability-1.2.1 | README |
cacheability-1.2.2 | README |