-
Notifications
You must be signed in to change notification settings - Fork 37.7k
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-busting does not work when lazy-initialization is enabled #25488
Comments
When The problem can be worked around by ensuring that @Bean
public LazyInitializationExcludeFilter eagerResourceHandlerMapping() {
return (name, definition, type) -> "resourceHandlerMapping".equals(name);
} |
I think this may be a Framework bug. I think a similar problem could arise without lazy init if I wonder if |
This commit makes sure to initialize any HandlerMapping defined in the context when searching for resource handlers. Previously, the detection algorithm was looking up for `SimpleUrlHandlerMapping` while the declared target type in WebMvcConfigurationSupport is HandlerMapping. If the application uses lazy initialization, the lookup algorithm would not force that bean to be initialized. Closes spring-projectsgh-25488
I've pushed a proposal for this in snicoll@33d15dd |
Original issue here: thymeleaf/thymeleaf-spring#227
It seems like cache-busting does not work when lazy initialization is active. Once I set it to false cache-busting works again.
This seems like a bug for the docs say:
But this does not seem to be true for whatever component is responsible for
spring.resources.chain.strategy.content
.Spring boot versions tested: 2.2.2 and 2.2.6
Tested with Thymeleaf
Miminal setup:
Check out https://github.com/ultraq/gs-serving-web-content/tree/cache-busting-issue/complete (branch cache-busting-issue).
In
application.properties
:Maybe this behaviour is intended / to be expected - if so please add a paragraph to the docs.
The text was updated successfully, but these errors were encountered: