Module: Decidim::Headers::HttpCachingDisabler

Extended by:
ActiveSupport::Concern
Included in:
Admin::ApplicationController, ApplicationController, System::ApplicationController
Defined in:
decidim-core/app/controllers/concerns/decidim/headers/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



16
17
18
19
20
# File 'decidim-core/app/controllers/concerns/decidim/headers/http_caching_disabler.rb', line 16

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