Skip to content

Commit

Permalink
fix: Use "Last-Modified" to controller the static resource caching me…
Browse files Browse the repository at this point in the history
…chanism

So index.html won't be cached too long.
  • Loading branch information
CH3CHO committed Oct 20, 2023
1 parent 9c3f849 commit 8f08724
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class WebMvcInitializer implements WebMvcConfigurer {

@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/*").addResourceLocations("classpath:/static/").setCachePeriod(3600)
registry.addResourceHandler("/*").addResourceLocations("classpath:/static/").setUseLastModified(true)
.resourceChain(true).addResolver(new PathResourceResolver() {
@Override
protected Resource resolveResourceInternal(HttpServletRequest request, @NonNull String requestPath,
Expand Down

0 comments on commit 8f08724

Please sign in to comment.