white knight

导航

 
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/")
.setCacheControl(CacheControl.maxAge(1, TimeUnit.HOURS).cachePublic());
}

}
posted on 2018-08-07 11:42  white knight  阅读(160)  评论(0编辑  收藏  举报