From ae92513aa752af4b0904165bd88dd14d32e67372 Mon Sep 17 00:00:00 2001 From: Kat <54268893+kosiakkatrina@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:38:17 +0000 Subject: [PATCH] Clear cache --- app/controllers/form_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/controllers/form_controller.rb b/app/controllers/form_controller.rb index 9475abe8d..7ce63e609 100644 --- a/app/controllers/form_controller.rb +++ b/app/controllers/form_controller.rb @@ -5,6 +5,7 @@ class FormController < ApplicationController before_action :find_resource, only: %i[review] before_action :find_resource_by_named_id, except: %i[review] before_action :check_collection_period, only: %i[submit_form show_page] + before_action :set_cache_headers, only: [:show_page] def submit_form if @log @@ -444,4 +445,10 @@ private def updated_answer_from_check_errors_page? params["check_errors"] end + + def set_cache_headers + response.headers["Cache-Control"] = "no-store, no-cache, must-revalidate, max-age=0" + response.headers["Pragma"] = "no-cache" + response.headers["Expires"] = "Mon, 01 Jan 1990 00:00:00 GMT" + end end