From 1f3e09567ca81ec897ad7b92d5d3efbdb5f42842 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Sat, 14 Aug 2021 11:42:01 -0400 Subject: [PATCH] Use no-store for web UI to prevent intermediate caching --- lib/sidekiq/web/action.rb | 2 +- lib/sidekiq/web/application.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sidekiq/web/action.rb b/lib/sidekiq/web/action.rb index 0ce6f655e..b525923e2 100644 --- a/lib/sidekiq/web/action.rb +++ b/lib/sidekiq/web/action.rb @@ -68,7 +68,7 @@ def render(engine, content, options = {}) end def json(payload) - [200, {"Content-Type" => "application/json", "Cache-Control" => "no-cache"}, [Sidekiq.dump_json(payload)]] + [200, {"Content-Type" => "application/json", "Cache-Control" => "no-store"}, [Sidekiq.dump_json(payload)]] end def initialize(env, block) diff --git a/lib/sidekiq/web/application.rb b/lib/sidekiq/web/application.rb index 1d2f23727..d1277bb16 100644 --- a/lib/sidekiq/web/application.rb +++ b/lib/sidekiq/web/application.rb @@ -314,7 +314,7 @@ def call(env) # rendered content goes here headers = { "Content-Type" => "text/html", - "Cache-Control" => "no-cache", + "Cache-Control" => "no-store", "Content-Language" => action.locale, "Content-Security-Policy" => CSP_HEADER }