File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -2868,7 +2868,7 @@ evaluated and if present a `304` status code is returned.
2868
2868
public void addResourceHandlers(ResourceHandlerRegistry registry) {
2869
2869
registry.addResourceHandler("/resources/**")
2870
2870
.addResourceLocations("/public", "classpath:/static/")
2871
- .setCachePeriod(31556926 );
2871
+ .setCacheControl(CacheControl.maxAge(365, TimeUnit.DAYS) );
2872
2872
}
2873
2873
2874
2874
}
@@ -2912,9 +2912,12 @@ so it can be injected into others.
2912
2912
2913
2913
Unlike Spring MVC at present in WebFlux there is no way to transparently rewrite static
2914
2914
resource URLs since there are no view technologies that can make use of a non-blocking chain
2915
- of resolvers and transformers (e.g. resources on Amazon S3). When serving only local
2916
- resources the workaround is to use `ResourceUrlProvider` directly (e.g. through a custom
2917
- tag) and block for 0 seconds.
2915
+ of resolvers and transformers. When serving only local resources the workaround is to use
2916
+ `ResourceUrlProvider` directly (e.g. through a custom tag) and block.
2917
+
2918
+ Note that when using both `GzipResourceResolver` and `VersionedResourceResolver`, they must
2919
+ be registered in that order to ensure content based versions are always computed reliably
2920
+ based on the unencoded file.
2918
2921
2919
2922
http://www.webjars.org/documentation[WebJars] is also supported via `WebJarsResourceResolver`
2920
2923
and automatically registered when `"org.webjars:webjars-locator"` is present on the
You can’t perform that action at this time.
0 commit comments