Closed benschwarz closed 11 years ago
I wasn't able to reproduce this. I switched to http://www.google.com
, and it it was not storing anything in memcached on the first request.
Also, you might want to look at the caching code in rack-client, it's intended to be used for client side caching.
If you don't have the memcached
gem in your gemfile, it simply won't do anything.
Also, the request won't get written to memcached if you're hitting a resource that is Cache-Control: Private
'd
From there, it should be pretty reproducible.
In the mean time I'll checkout the stuff you guys have implemented, I didn't realise it existed.
The setup:
HTTPClient.get "http://google.com"
=> success, gets stored in memcachedHTTPClient.get "http://google.com"
=> Kaboom.NoMethodError: undefined method'ruby-1.9.2-p0 >
strip' for nil:NilClass from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/gems/activesupport-3.0.0/lib/active_support/whiny_nil.rb:48:in
method_missing' from /Users/ben/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:1296:inblock in initialize_http_header' from /Users/ben/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:1294:in
each' from /Users/ben/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:1294:ininitialize_http_header' from /Users/ben/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:1662:in
initialize' from /Users/ben/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:1779:ininitialize' from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/bundler/gems/rack-client-a7c0e06f2ca4/lib/rack/client/handler/net_http.rb:51:in
new' from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/bundler/gems/rack-client-a7c0e06f2ca4/lib/rack/client/handler/net_http.rb:51:innet_request_for' from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/bundler/gems/rack-client-a7c0e06f2ca4/lib/rack/client/handler/net_http.rb:18:in
sync_call' from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/bundler/gems/rack-client-a7c0e06f2ca4/lib/rack/client/core/dual_band.rb:8:incall' from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/gems/rack-cache-0.5.3/lib/rack/cache/context.rb:129:in
forward' from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/gems/rack-cache-0.5.3/lib/rack/cache/context.rb:200:invalidate' from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/gems/rack-cache-0.5.3/lib/rack/cache/context.rb:174:in
lookup' from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/gems/rack-cache-0.5.3/lib/rack/cache/context.rb:65:incall!' from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/gems/rack-cache-0.5.3/lib/rack/cache/context.rb:50:in
call' from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/bundler/gems/rack-client-a7c0e06f2ca4/lib/rack/client/adapter/base.rb:24:inrequest' from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/bundler/gems/rack-client-a7c0e06f2ca4/lib/rack/client/adapter/simple.rb:56:in
request' from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/bundler/gems/rack-client-a7c0e06f2ca4/lib/rack/client/adapter/simple.rb:38:inget' from (irb):3 from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/gems/railties-3.0.0/lib/rails/commands/console.rb:44:in
start' from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/gems/railties-3.0.0/lib/rails/commands/console.rb:8:instart' from /Users/ben/.rvm/gems/ruby-1.9.2-p0@hoard/gems/railties-3.0.0/lib/rails/commands.rb:23:in
<top (required)>' from script/rails:9:inrequire' from script/rails:9:in