Skip to content

Commit

Permalink
Set expiry of theme CSS to 3 months
Browse files Browse the repository at this point in the history
The `ETag` from `fresh_when` takes care of cache busting here.
  • Loading branch information
raccube committed Feb 1, 2023
1 parent 679ecb9 commit 7caa767
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/user_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def show_theme
theme = Theme.where(user: User.where("LOWER(screen_name) = ?", params[:username].downcase).select(:id)).first
return head :no_content if theme.nil?

Check warning on line 25 in app/controllers/user_controller.rb

View check run for this annotation

Codecov / codecov/patch

app/controllers/user_controller.rb#L24-L25

Added lines #L24 - L25 were not covered by tests

expires_in 1.day
expires_in 3.months
return if fresh_when theme, public: true

Check warning on line 28 in app/controllers/user_controller.rb

View check run for this annotation

Codecov / codecov/patch

app/controllers/user_controller.rb#L27-L28

Added lines #L27 - L28 were not covered by tests

render plain: get_theme_css(theme), content_type: "text/css"

Check warning on line 30 in app/controllers/user_controller.rb

View check run for this annotation

Codecov / codecov/patch

app/controllers/user_controller.rb#L30

Added line #L30 was not covered by tests
Expand Down

0 comments on commit 7caa767

Please sign in to comment.