Increased default expire of cache from 1 day to 7 days.

This commit is contained in:
Martin Edenhofer 2015-06-24 13:33:07 +02:00
parent 7b87bf23af
commit 396cc08c5a

View file

@ -18,9 +18,9 @@ write a cache
Cache.write( Cache.write(
'some_key', 'some_key',
{ :some => { :data => { 'structure' } } }, { some: { data: { 'structure' } } },
{ {
:expires_in => 24.hours, # optional :expires_in => 24.hours, # optional, default 7 days
} }
) )
@ -28,7 +28,7 @@ write a cache
def self.write( key, data, params = {} ) def self.write( key, data, params = {} )
if !params[:expires_in] if !params[:expires_in]
params[:expires_in] = 24.hours params[:expires_in] = 7.days
end end
begin begin
Rails.cache.write(key.to_s, data, params) Rails.cache.write(key.to_s, data, params)