Skip to content

Commit

Permalink
Merge pull request #102 from epimorphics/spike/add-cache-header-to-ap…
Browse files Browse the repository at this point in the history
…p-controller

Set the `change_default_caching_policy` in the app `before_action`s
  • Loading branch information
jonrandahl authored Jul 11, 2023
2 parents d88e3f6 + 823bd60 commit 11ac712
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Standard Reports UI: change log

## 1.5.0.1 - 2023-07-11

- (Jon) Updated the `app/controllers/application_controller.rb` to include the
`before_action` for the `change_default_caching_policy` method to ensure the
default `Cache-Control` header for all requests is set to 5 minutes (300 seconds).

## 1.5.0 - 2023-07-05

- (Jon) This sets the cache control headers to be public and cacheable with a
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class ApplicationController < ActionController::Base
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception

before_action :change_default_caching_policy

around_action :log_request_result
def log_request_result
start = Process.clock_gettime(Process::CLOCK_MONOTONIC, :microsecond)
Expand Down
2 changes: 1 addition & 1 deletion app/lib/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ module Version
MAJOR = 1
MINOR = 5
PATCH = 0
SUFFIX = nil
SUFFIX = 1
VERSION = "#{MAJOR}.#{MINOR}.#{PATCH}#{SUFFIX && ".#{SUFFIX}"}"
end

0 comments on commit 11ac712

Please sign in to comment.