New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Caching with Rails does not work as specified on README.md #380
Comments
@trein thanks for reporting! There are typhoeus/lib/typhoeus/request.rb Line 164 in bbd817c
Request#hash typhoeus/lib/typhoeus/request.rb Line 156 in bbd817c
cache_key is automatically picked up by ActiveSupport...
|
See http://guides.rubyonrails.org/caching_with_rails.html 2.9: Cache keys. |
@i0rek thanks for the heads up. I can see that def cache_key
"#{self.class.name}#{base_url}#{hashable_string_for(options)}"
end I will double check whether I'm changing it for every request as soon as I get home. It would be an explanation why I'm experiencing cache miss. |
@i0rek I double checked my implementation and realized I was using v0.6.6. That version does not have the Updating to v0.6.8 it seems to be working, but I ended up getting a different error when caching the request: |
I cannot remember why we didn't do that in the first place. should be fine. |
Here it goes my suggestion. I've just tested and it's working perfectly for me. |
Could you change the method |
... And create a PR? |
Well, |
Sorry, I did not got an email for your comment :(. |
@i0rek Great. I've just created a PR. |
fixed long cachekeys reported on issue #380
Very nice! |
this issue can be closed now, right? |
Yes! Closing. |
I followed the instructions on
README.md
(snippet below)on how to setup caching on Rails, but I did not work out. I had to change
Cache
implementation in order to define a different key forRails.cache
:Maybe it would be a good idea to add a unique attribute in
Typhoeus::Request
so that it can be used as key of the cache.The text was updated successfully, but these errors were encountered: