rtomayko / rack-cache
- Source
- Commits
- Network (11)
- Issues (4)
- Graphs
-
Branch:
master
Pledgie Donations
Once activated, we'll place the following badge in your repository's detail box:
Real HTTP Caching for Ruby Web Apps
-
It is possible that multiple etags are valid. rack-cache should therefore support multiple etags per uri.
Comments
-
not_modified? does not conform to the http specification
3 comments Created 16 days ago by minadAccording to the HTTP specification §14.26 a server must ignore the if-not-modified-since if no etag matched:
"If none of the entity tags match, then the server MAY perform the requested method as if the If-None-Match header field did not exist, but MUST also ignore any If-Modified-Since header field(s) in the request. That is, if no entity tags match, then the server MUST NOT return a 304 (Not Modified) response."
I will write a patch
Comments
-
We're using memcache as our metastore in production, but we're noticing alot of timeout errors. The reason for the errors isn't rack-cache's problem but rack-cache is letting these unrescuable exceptions surface into 500s.
It would be nice if rack-cache rescued from any internal exceptions and logged them, but passed the request along to the app.
http://github.com/josh/rack-cache/commit/7bcd0cec2723b91ee0d557153134d457219895ba
Comments
-
It's currently not possible to use more than a single memcached server for storage. Seth Faxon did some work on this and sent me a patch. Here's his email:
I spent some time this weekend modifying your Rack::Cache gem to work with the memcache-client gem. I needed it to work with multiple memcache servers, so I broke the URI convention you were using. I'm using it in a Rails app and the new config lines look like:
config.middleware.use(Rack::Cache, :verbose => true, :metastore => {:memcache => {:server => ['127.0.0.1:11211', '127.0.0.2:11211'], :namespace => 'nui_meta'}}, :entitystore => {:memcache => {:server => ['127.0.0.1:11211', '127.0.0.2:11211'], :namespace => 'nui_entity'}})The entity store and cachecontrol changes are pretty straight forward. I did change the MEMCACHE static variable to use the MemCache gem.
The other significant change was to metastore.rb, if the memcache server is down the response body returns nil. I added a check at line 63 of metastore.rb to put the body back after the read fails.
I'm planning on writing tests this afternoon, and just wanted to get some feedback from you to see if this is a direction you wanted to go. I have no desire to fork this, and if you have some feedback I would like to incorporate it.
Thanks for the great gem, this was my first time playing with Rack and I was able to jump in pretty quickly with the stuff you provided.
Comments
-
Rack Cache won't let you use memcached for metastore
1 comment Created 7 months ago by namelessjonThere's a typo in the code used to determine which memcached gem to use. The patch in the gist fixes this
Comments





I am not so sure about this one. Is it necessary to use the vary-header in this case with "Vary: If-None-Match"?
Merged the patches branch. I believe that fixed us, no?