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

Set Cache-Control no-cache for static resources in development mode. #230

Merged
merged 1 commit into from Apr 24, 2013

Conversation

davidw
Copy link
Contributor

@davidw davidw commented Mar 27, 2013

This won't work without the modifications I made to simple_bridge:

nitrogen/simple_bridge#21

@evanmiller
Copy link
Contributor

Thanks.

In production the old behavior should be restored (a long cache period, e.g. 10 years).

Also viewing the diff above, there appears to be something wacky in the patch's spacing.

I will wait to see what Jesse decided on nitrogen/simple_bridge#21 before moving forward.

@davidw
Copy link
Contributor Author

davidw commented Mar 27, 2013

I'm not positive that setting an Expires is the best course of action - isn't the 'if-modified-since' system a little bit more robust if someone actually does change the file in question?

@evanmiller
Copy link
Contributor

That's a good point. "Expires" does seem to be causing some headaches for people in production, and I think folks who want high-performance static assets will choose other solutions (Nginx, S3, etc).

I'm OK with the proposed changes as they stand, then. In the future it would be nice to support If-Modified-Since or ETag somehow.

@davidw
Copy link
Contributor Author

davidw commented Mar 27, 2013

I don't know what's doing it, but my application is happily returning 304's for static requests, which seems right to me.

@evanmiller
Copy link
Contributor

Well by George! Perhaps some under-the-hat Cowboy magic is at work.

I'd like to include this change in the next release, so if we don't hear from Jesse I'll just point rebar.config at your branch.

@evanmiller
Copy link
Contributor

OK -- looks like Jesse got your SimpleBridge changes merged in, so I will go ahead and merge this in and update the SimpleBridge version as well. Thanks for your patience!

evanmiller added a commit that referenced this pull request Apr 24, 2013
Set Cache-Control no-cache for static resources in development mode.
@evanmiller evanmiller merged commit 585e94c into ChicagoBoss:master Apr 24, 2013
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.

None yet

2 participants