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

HandlerExceptionResolvers should prevent caching of response [SPR-7334] #11993

Closed
spring-projects-issues opened this issue Jun 28, 2010 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

marc schipperheyn opened SPR-7334 and commented

The WebContentInterceptor allows you to specify the cache seconds for a request. It processes them in the preHandle method.

However, the postHandle method is empty. It should check whether an error was thrown by the controller and prevent caching it there was.


Affects: 3.0.3

Referenced from: commits df5e9b1

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

This is actually more of a problem to be solved by HandlerExceptionResolvers: They should prevent caching in any exceptional case, no matter whether a WebContentInterceptor was involved, and no matter whether cache headers have been set before in general.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

As of Spring 3.0.4, AbstractHandlerExceptionResolver has a "preventResponseCaching" bean property which may be set to "true" in order to prevent caching for exception views. Since all of Spring's HandlerExceptionResolver impls extend that base class, this should be available for any choice of resolver now.

This will be available in tonight's 3.0.4 snapshot - feel free to give it an early try...

Juergen

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0.4 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants