Spring 全家桶使用Spring-Security后,浏览器不能缓存的问题解决项目中使用SpringSecurity浏览器不能缓存问题Spring-Security在默认情况下是不允许客户端进行缓存的,在使用时可以通过禁用Spring-Security中的cacheControl配置项允许缓存。1 2 3 4 protected void configure(HttpSecurity http) throws Exception { // 允许缓存配置 http.headers().cacheControl().disable(); }