Module: SuperHttpCache

Defined in:
lib/supercache/super_http_cache.rb

Instance Method Summary collapse

Instance Method Details

#request(*args, &block) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/supercache/super_http_cache.rb', line 3

def request(*args, &block)
  if Rails.cache.read(:http_supercache)
    Rails.cache.fetch(Digest::SHA1.hexdigest(args[0].path.to_s + args[0].body.to_s)) do
      super(*args, &block)
    end
  else
    super(*args, &block)
  end
end