Skip to content

Commit

Permalink
fix(controller): disable browser cache
Browse files Browse the repository at this point in the history
  • Loading branch information
cynek committed Sep 6, 2017
1 parent edbc6f6 commit 92531ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/controllers/resque/jobs_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module Resque
class JobsController < ActionController::Metal
include ActionController::ConditionalGet

JOB_ID_PATTERN = /([a-f0-9]{32})/

def show
Expand All @@ -23,6 +25,7 @@ def show
self.status = 200
self.content_type = "application/json; charset=utf-8"
self.response_body = MultiJson.dump(data)
expires_now
end

private
Expand Down
1 change: 1 addition & 0 deletions spec/resque/controllers/jobs_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def self.perform(_meta_id); end
it do
expect(last_response.status).to eq 200
expect(last_response.body).to eq body
expect(last_response['Cache-Control']).to eq 'no-cache'
end
end
end
Expand Down

0 comments on commit 92531ff

Please sign in to comment.