Sha256: c0b0f4ffc7167322edc992d8add521ffdaebdae05d6648892d0d4224c9360ff0
Contents?: true
Size: 698 Bytes
Versions: 5
Compression:
Stored size: 698 Bytes
Contents
module Storefront module CacheHelper def optional_cache(key, &block) cache(key, &block) unless session[:disable_caching] end def conditional_cache(key, options = {}, &block) condition = true condition = false if options.has_key?(:if) && options[:if] != true if condition cache(key, &block) else haml_concat capture_haml(&block) end end def set_cache_buster if request.xhr? response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate" response.headers["Pragma"] = "no-cache" response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT" end end end end
Version data entries
5 entries across 5 versions & 1 rubygems