Module: Schnitzelpress::CacheControl

Defined in:
lib/schnitzelpress/cache_control.rb

Class Method Summary collapse

Class Method Details

.bust!Object



8
9
10
# File 'lib/schnitzelpress/cache_control.rb', line 8

def bust!
  Schnitzelpress::Config.set 'cache_timestamp', Time.now
end

.etag(*args) ⇒ Object



12
13
14
# File 'lib/schnitzelpress/cache_control.rb', line 12

def etag(*args)
  Digest::MD5.hexdigest("-#{timestamp.to_i}-#{args.join '-'}-")
end

.timestampObject



4
5
6
# File 'lib/schnitzelpress/cache_control.rb', line 4

def timestamp
  Schnitzelpress::Config.get 'cache_timestamp'
end