Skip to content

Commit

Permalink
tidy things up a bit for release
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Oct 24, 2008
1 parent 383a096 commit 3381abc
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 81 deletions.
33 changes: 25 additions & 8 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
## 0.1 (Sunday, August 3, 2008)
## 0.2.0 / 2008-10-24 / Initial Release

* Basic core with event support
* An #import method for bringing in config files
* Implement freshness based expiration
* Implement RFC 2616 If-Modified-Since based validation
* A not horribly shitty storage back-end (Hash in mem if we have to)
* Don't cache headers: Connection, Keep-Alive, Proxy-Authenticate, Proxy-Authorization
TE, Trailers, Transfer-Encoding, Upgrade
* Document events and transitions in `rack/cache/config/default.rb`
* Basic logging support (`trace`, `warn`, `info`, `error` from within Context)
* EntityStore: store entity bodies keyed by SHA
* MetaStore: store response headers keyed by URL
* Last-Modified/ETag validation
* Vary support
* Implement error! transition
* New Rack::Cache::Core
* memcached meta and entity store implementations
* URI based storage configuration
* Read options from Rack env if present (rack-cache.XXX keys)
* `object` is now `entry`
* Documentation framework and website
* Document storage areas and implementations
* Document configuration/events

## 0.1.0 / 2008-07-21 / Proof of concept (unreleased)

* Basic core with event support
* `#import` method for bringing in config files
* Freshness based expiration
* RFC 2616 If-Modified-Since based validation
* A horribly shitty storage back-end (Hash in mem)
* Don't cache hop-by-hop headers: Connection, Keep-Alive, Proxy-Authenticate,
Proxy-Authorization, TE, Trailers, Transfer-Encoding, Upgrade
35 changes: 18 additions & 17 deletions README
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
Rack::Cache
===========

Rack::Cache is suitable as a quick drop-in component to enable HTTP caching for
Rack-based applications that produce freshness (Expires, Cache-Control) and/or
validation (Last-Modified, ETag) information.

We strive to implement those portions of RFC 2616 Section 13 relevant to gateway
(i.e., "reverse proxy") cache scenarios with a system for specifying cache
policy. Rack::Cache is suitable as a quick, drop-in component to enable HTTP
caching for Rack-enabled applications that produce freshness (Expires,
Cache-Control) and/or validation (Last-Modified, ETag) information.
policy:

* Standards-based (RFC 2616 compliance)
* Freshness/expiration based caching and validation
* Supports HTTP Vary
* Standards-based (RFC 2616)
* Freshness/expiration based caching
* Validation
* Vary support
* Portable: 100% Ruby / works with any Rack-enabled framework
* VCL-like configuration language for advanced caching policies
* Configuration language for advanced caching policies
* Disk, memcached, and heap memory storage backends

For more information about Rack::Cache features and usage, see:
Expand All @@ -21,8 +24,8 @@ http://tomayko.com/src/rack-cache/
Rack::Cache is not overly optimized for performance. The main goal of the
project is to provide a portable, easy-to-configure, and standards-based
caching solution for small to medium sized deployments. More sophisticated /
performant caching systems (e.g., Varnish, Squid, httpd/mod-cache) may be
more appropriate for large deployments with crazy throughput requirements.
high-performance caching systems (e.g., Varnish, Squid, httpd/mod-cache) may be
more appropriate for large deployments with significant throughput requirements.

Status
------
Expand Down Expand Up @@ -53,11 +56,12 @@ or uses Rack::Builder to construct the application pipeline, simply require
and use as follows:

require 'rack/cache'
use Rack::Cache do
set :metastore, 'file:/var/cache/rack/meta'
set :entitystore, 'file:/var/cache/rack/body'
set :verbose, true
end

use Rack::Cache,
:metastore => 'file:/var/cache/rack/meta',
:entitystore => 'file:/var/cache/rack/body',
:verbose => true

run app

Assuming you've designed your backend application to take advantage of HTTP's
Expand All @@ -67,9 +71,6 @@ caching.
Documentation
-------------

The "doc/" directory includes documentation on Rack::Cache configuration and
use; also available on the web:

http://tomayko.com/src/rack-cache/

License
Expand Down
10 changes: 9 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rake/clean'

task :default => :spec
task :default => :test

CLEAN.include %w[coverage/ doc/api tags]
CLOBBER.include %w[dist]
Expand Down Expand Up @@ -116,6 +116,14 @@ file package('.tar.gz') => %w[dist/] + $spec.files do |f|
sh "git archive --format=tar HEAD | gzip > #{f.name}"
end

desc 'Upload gem and tar.gz distributables to rubyforge'
task :release => [package('.gem'), package('.tar.gz')] do |t|
sh <<-SH
rubyforge add_release wink rack-cache #{$spec.version} #{package('.gem')} &&
rubyforge add_file wink rack-cache #{$spec.version} #{package('.tar.gz')}
SH
end

# GEMSPEC ===================================================================

file 'rack-cache.gemspec' => FileList['{lib,test}/**','Rakefile'] do |f|
Expand Down
25 changes: 0 additions & 25 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
## 0.1 / 2008-07-21 / Unreleased

* Proof of concept
* Store everything in memory

## 0.2

* Baseline caching logic moved out of config, into Rack::Cache::Core
* Document events and transitions in rack/cache/config/default.rb
* Basic logging support (trace, debug, warn, info from within Context)
* EntityStore: store entity bodies keyed by SHA
* MetaStore: store response headers keyed by URL
* Add support for Vary
* ETag validation
* Implement error! transition
* memcached meta and entity store implementations
* Get rid of default_entity_store
* URL based storage configuration
* Read options from Rack env if present (rack-cache.XXX keys)
* Rename `object` to `entry`.
* Documentation Framework and Website
* Document storage areas and implementations
* Document configuration/events
- Document request, response, cached object

## 0.3

- BUG: meta store hits but entity misses
Expand Down
54 changes: 29 additions & 25 deletions doc/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,12 @@ for [Rack][]-based applications that produce freshness (`Expires`,
`Cache-Control`) and/or validation (`Last-Modified`, `ETag`) information.

* Standards-based ([RFC 2616][rfc] / [Section 13][s13]).
* Freshness/expiration based caching and validation.
* Portable: 100% Ruby / works with any Rack-enabled framework.
* [VCL][]ish configuration language for advanced caching policies.
* Disk, memcached, and heap memory storage backends.

[rfc]: http://tools.ietf.org/html/rfc2616
"RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1 [ietf.org]"

[s13]: http://tools.ietf.org/html/rfc2616#section-13
"RFC 2616 / Section 13 Caching in HTTP"

[rack]: http://rack.rubyforge.org/
"Rack: a Ruby Webserver Interface"

[vcl]: http://tomayko.com/man/vcl
"VCL(7) -- Varnish Configuration Language Manual Page"
* Freshness/expiration based caching
* Validation
* Vary Support
* Portable: 100% Ruby / works with any [Rack][]-enabled framework.
* [Configuration language][config] for advanced caching policies.
* Disk, memcached, and heap memory [storage backends][storage].

Status
------
Expand Down Expand Up @@ -58,16 +48,15 @@ simply `require` and `use` as follows:
Assuming you've designed your backend application to take advantage of HTTP's
caching features, no further code or configuration is required for basic
caching. More sophisticated stuff is possible with [Rack::Cache's Configuration
Language](./configuration).
Language][config].

Advanced Usage
--------------

* [Configuration Language Documentation](./configuration) - How to
customize cache policy using the simple event-based configuration
system.
* [Configuration Language Documentation][config] - How to customize cache
policy using the simple event-based configuration system.

* [Cache Storage Documentation](./storage) - Detailed information on the various
* [Cache Storage Documentation][storage] - Detailed information on the various
storage implementations available in __Rack::Cache__ and how to choose the one
that's best for your application.

Expand All @@ -88,16 +77,16 @@ The overall design of __Rack::Cache__ is based largely on the work of the
internet standards community. The following resources provide a good starting
point for exploring the basic concepts of HTTP caching:

* [RFC 2616](http://www.ietf.org/rfc/rfc2616.txt), especially
[Section 13, "Caching in HTTP"](http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html)

* Mark Nottingham's [Caching Tutorial](http://www.mnot.net/cache_docs/),
especially the short section on
[How Web Caches Work](http://www.mnot.net/cache_docs/#WORK)

* Joe Gregorio's [Doing HTTP Caching Right](http://www.xml.com/lpt/a/1642)

__Rack::Cache__ takes (liberally) various concepts from
* [RFC 2616](http://www.ietf.org/rfc/rfc2616.txt), especially
[Section 13, "Caching in HTTP"](http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html)

__Rack::Cache__ takes (_liberally_) various concepts from
[Varnish](http://varnish.projects.linpro.no/) and
[Django's cache framework](http://docs.djangoproject.com/en/dev/topics/cache/).

Expand All @@ -107,3 +96,18 @@ License
__Rack::Cache__ is Copyright &copy; 2008
by [Ryan Tomayko](http://tomayko.com/about)
and is provided under [the MIT license](./license)

[config]: ./configuration "Rack::Cache Configuration Language Documentation"
[storage]: ./storage "Rack::Cache Storage Documentation"

[rfc]: http://tools.ietf.org/html/rfc2616
"RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1 [ietf.org]"

[s13]: http://tools.ietf.org/html/rfc2616#section-13
"RFC 2616 / Section 13 Caching in HTTP"

[rack]: http://rack.rubyforge.org/
"Rack: a Ruby Webserver Interface"

[vcl]: http://tomayko.com/man/vcl
"VCL(7) -- Varnish Configuration Language Manual Page"
10 changes: 5 additions & 5 deletions rack-cache.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=

s.name = 'rack-cache'
s.version = '0.2'
s.date = '2008-10-21'
s.version = '0.2.0'
s.date = '2008-10-24'

s.description = "Caching middleware for Rack"
s.summary = "Caching middleware for Rack"
s.description = "HTTP Caching for Rack"
s.summary = "HTTP Caching for Rack"

s.authors = ["Ryan Tomayko"]
s.email = "r@tomayko.com"
Expand Down Expand Up @@ -63,7 +63,7 @@ Gem::Specification.new do |s|
s.test_files = s.files.select {|path| path =~ /^test\/.*_test.rb/}

s.extra_rdoc_files = %w[COPYING]
s.add_dependency 'rack', '>= 0.4.0'
s.add_dependency 'rack', '~> 0.4'

This comment has been minimized.

Copy link
@sporkmonger

sporkmonger May 5, 2009

Needless to say, this doesn't play nicely with Rack 1.0. :-(


s.has_rdoc = true
s.homepage = "http://github.com/rtomayko/rack-cache"
Expand Down

0 comments on commit 3381abc

Please sign in to comment.