Module: Decidim::HttpCachingDisabler

Extended by:
ActiveSupport::Concern
Included in:
ApplicationController
Defined in:
app/controllers/concerns/decidim/http_caching_disabler.rb

Overview

This module will disable http caching from the controller in order to prevent proxies from storing sensible information.

Instance Method Summary collapse

Instance Method Details

#disable_http_cachingObject



15
16
17
18
19
# File 'app/controllers/concerns/decidim/http_caching_disabler.rb', line 15

def disable_http_caching
  response.headers["Pragma"] = "no-cache"
  response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
  response.cache_control.replace(no_cache: true, extras: ["no-store"])
end