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
spring-web: Cannot create Cache-Control: no-store, no-cache with new CacheControl API [SPR-13780] #18354
Comments
Brian Clozel commented Hi Thomas Tardy |
Thomas Tardy commented Older browsers doesn't correctly support no-cache and no-store is required in addition. See http://stackoverflow.com/questions/866822/why-both-no-cache-and-no-store-should-be-used-in-http-response |
Brian Clozel commented I don't see any reference stating that When deciding on those static methods, I looked hard and found no evidence of Do you have a reference that states that some browser versions don't support Thanks! |
Thomas Tardy commented
How would you do that with the |
Brian Clozel commented You can't, that's the point. This API has been designed to help developers make the right decision. When I'm referring to "stacking up directives", I think this is a wrong thing to recommend since you're sending mixed signals to HTTP clients. For me it doesn't make sense to use Now I'm just trying to make the right choice: should we open this possibility because it's actually useful? Or should we leave it as it is because using both directives is some kind of anti-pattern. Do you know if a particular HTTP client/browser needs that combination? I'd be happy to test it. Thanks, |
Thomas Tardy commented
No, I'm not. We should be fine with Thanks a lot for your quick responses and your support! |
Brian Clozel commented Thanks for this report Thomas Tardy, don't hesitate to reopen/create a new issue if you find something new. |
Aurélien Leboulanger commented If the no-cache + no-store mention isn't supported by the CacheControl API builder, please remove this comment from the javadoc of the /**
[...]
* <p>In order to disable caching and minimize requests/responses exchanges, the {@link #noStore()} directive
* should be used.
[...]
*/ |
spring-projects-issues commentedDec 9, 2015
Thomas Tardy opened SPR-13780 and commented
We are migrating a project from spring-web 4.1.8 to 4.2.3 and need to replace the deprecated code
with the usage of the new
CacheControl
andinterceptor.setCacheControl(cacheControl)
.But with the new API of
CacheControl
, you cannot usenoStore()
andnoCache()
together as these methods return a newCacheControl
and aren't updating the existing ones.As it is still required to set the
Cache-Control
header tono-store, no-cache
to disable caching in different browsers, this should be possible.Affects: 4.2.3
The text was updated successfully, but these errors were encountered: