使用Spring-Security后,浏览器不能缓存的问题

Spring-Security在默认情况下是不允许客户端进行缓存的,在使用时可以通过禁用Spring-Security中的cacheControl配置项允许缓存。

java 复制代码
protected void configure(HttpSecurity http) throws Exception {
        // 允许缓存配置
        http.headers().cacheControl().disable();
}
相关推荐
2301_7703737319 小时前
Java集合
java·开发语言
哈喽姥爷19 小时前
Spring Boot---自动配置原理和自定义Starter
java·spring boot·后端·自定义starter·自动配置原理
老华带你飞21 小时前
考研论坛平台|考研论坛小程序系统|基于java和微信小程序的考研论坛平台小程序设计与实现(源码+数据库+文档)
java·vue.js·spring boot·考研·小程序·毕设·考研论坛平台小程序
CHEN5_0221 小时前
leetcode-hot100 11.盛水最多容器
java·算法·leetcode
songx_9921 小时前
leetcode18(无重复字符的最长子串)
java·算法·leetcode
在路上`1 天前
前端学习之后端java小白(三)-sql外键约束一对多
java·前端·学习
dazhong20121 天前
Spring Boot 项目新增 Module 完整指南
java·spring boot·后端
xrkhy1 天前
SpringBoot之日志处理(logback和AOP记录操作日志)
java·spring boot·logback
搬山境KL攻城狮1 天前
MacBook logback日志输出到绝对路径
java·intellij-idea·logback
yb0os11 天前
RPC实战和核心原理学习(一)----基础
java·开发语言·网络·数据结构·学习·计算机·rpc