-
Notifications
You must be signed in to change notification settings - Fork 403
-
Notifications
You must be signed in to change notification settings - Fork 403
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
Stripping of caching headers prevents Rails stale?/ fresh_when method from working correctly #82
Comments
This is by design, only for profiled requests, it only impacts admins. If we let caching through you don't get correct results. |
This behavior is super unintuitive. I just wasted 3 hours on it. I posit that having this "by design" is a mistake. The profiler should be just that: a profiler. It's presence shouldn't force more work on the application server. If you're an admin, and you're looking at the mini-profiler output, then you're savvy enough to go into your Inspector panel and clear the cache when you want to force the server to perform the work. |
I am open to adding a config setting for this if you wish. PR welcome |
Excellent! I'll whip something up. |
Here you go! #96 |
closing this cause we have a setting for disabling cache busting now |
Hi,
as all caching headers (
HTTP_IF_MODIFIED_SINCE
andHTTP_IF_NONE_MATCH
) are stripped away inrack-mini-profiler/lib/mini_profiler/profiler.rb
Line 275 in 334da48
Basically the
stale?
(http://apidock.com/rails/ActionController/Base/stale%3F) method will always return true. The result is the kind of odd behaviour, that the server regenerates the content, but correctly sets the return code to 304.I wanted to use the mini profiler to check the impact of http caching in my application. I think this is especially an issue if you use the mini profiler also in production environments.
Jan
p.s. this discussion might also be interesting: rtomayko/rack-cache#24
The text was updated successfully, but these errors were encountered: