Spring Boot 静态资源设置缓存控制 Max-Age 返回头

Spring Boot About 176 words

配置

返回头中会增加Cache-Control: max-age=31536000,且客户端会得到304状态码,表示服务端未修改,浏览器不会真正获取资源文件,使用本地缓存。

spring:
  web:
    resources:
      cache:
        cachecontrol:
          max-age: 365d
Views: 794 · Posted: 2023-02-15

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh