Skip to content

Commit

Permalink
feat: ensure index page is not cached
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Apr 23, 2019
1 parent 7a242f2 commit 0cfa9bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/pact_broker/ui/controllers/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ module PactBroker
module UI
module Controllers
class Index < Base

include PactBroker::Services

get "/" do
set_headers
tags = nil
if params[:tags]
tags = params[:tags] == 'true' ? true : [*params[:tags]].compact
Expand All @@ -19,6 +19,11 @@ class Index < Base
haml page, {locals: {index_items: view_model, title: "Pacts"}, layout: :'layouts/main'}
end

def set_headers
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "0"
end
end
end
end
Expand Down

0 comments on commit 0cfa9bb

Please sign in to comment.