Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我必须创建一个处理用户敏感信息的 Web 应用程序。我需要在用户注销后立即清除浏览器的缓存,因为缓存的数据很容易受到攻击。应该强制客户端的浏览器从服务器端清除缓存。此外,所有缓存策略都必须从服务器端公开给客户端。
这个问题有什么解决办法吗?
将响应设置为立即过期,并且最好告诉代理等,不要缓存:
Expires: 0 Cache-control: private