Increased default expire of cache from 1 day to 7 days.
This commit is contained in:
parent
7b87bf23af
commit
396cc08c5a
1 changed files with 8 additions and 8 deletions
|
@ -18,9 +18,9 @@ write a cache
|
|||
|
||||
Cache.write(
|
||||
'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 = {} )
|
||||
if !params[:expires_in]
|
||||
params[:expires_in] = 24.hours
|
||||
params[:expires_in] = 7.days
|
||||
end
|
||||
begin
|
||||
Rails.cache.write(key.to_s, data, params)
|
||||
|
|
Loading…
Reference in a new issue