Skip to content

Commit

Permalink
Use no-store for web UI to prevent intermediate caching (sidekiq#4966)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunbennett authored and jonhyman committed Sep 16, 2021
1 parent f287416 commit b5c85f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/sidekiq/web/action.rb
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/web/application.rb
Expand Up @@ -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
}
Expand Down

0 comments on commit b5c85f3

Please sign in to comment.