Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache-Control header not set in Rails 5 #41

Merged
merged 2 commits into from
Oct 16, 2017

Conversation

dylanfisher
Copy link
Contributor

OK I think I got it working this time. Tested on Heroku against my fork and the correct headers are there.

If you're using Cloudfront you'll have to invalidate any cached assets after deploying.

Fixes #39

@brian-kephart
Copy link

Thanks. Is there a benefit to this method over the one used in #40?

@dylanfisher
Copy link
Contributor Author

Moving the conditional out of the set_max_age method seems cleaner, but otherwise #40 is better since it preserves existing headers.

In this version if the cache_control method returns all headers I think it would be better.

I'm not sure if app.config.static_cache_control = cache_control needs to explicitly be set. I took that line out, which might be a mistake.

@humphreybc
Copy link

Could we get this merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants