Closed tobinibot closed 8 years ago
The expires_in
option is certainly supported. You'll want to convert the period into seconds by using to_i
. Change your first example from 15.minutes
to 15.minutes.to_i
.
I did that. Also tried just a straight number. Still getting the 86400 TTL.
Rails.cache.fetch(:test_data, expires_in: 60) do
'hello world'
end
Rails.cache.fetch(:test_data, expires_in: 1.minute.to_i) do
'hello world'
end
Sorry if that last comment came off a bit brusque, I didn’t mean it to.
I'm currently trying to see if I get RubyMine to debug through the gem code as well to see if I can see where it’s going wrong, but I haven't been able to figure that out yet. I’ll let you know if I'm able to come up with any additional data.
I'm using readthis v 1.0.0, by the way.
Fixed by PR https://github.com/sorentwo/readthis/pull/28
I have the following configuration in my
development.rb
configuration file:In my controller, there are pieces of data I want to cache for different time periods.
The data is getting stored in Redis, but the TTL starts counting down from 86400 (1 day), not the specific time period I'm trying to use. Is the
expires_in
option not supported?