Spring-Security在默认情况下是不允许客户端进行缓存的,在使用时可以通过禁用Spring-Security中的cacheControl配置项允许缓存。
java
protected void configure(HttpSecurity http) throws Exception {
// 允许缓存配置
http.headers().cacheControl().disable();
}