【发布时间】:2016-10-26 06:20:47
【问题描述】:
我有一个搜索结果页面,当用户单击结果,然后单击返回按钮时,我希望它从缓存中加载搜索结果,而不是转到服务器,有点像 google 的做法。我正在发送 HTTP 标头:
Date: Thu, 23 Jun 2016 18:53:05 GMT
Server: WSGIServer/0.1 Python/2.7.9
Vary: Cookie
Last-Modified: Wed, 22 Jun 2016 00:00:00 GMT
ETag: a
Cache-Control: public, max-age=300
X-Frame-Options: SAMEORIGIN
Content-Type: text/html; charset=utf-8
但是当我使用后退按钮导航回结果时,它会从服务器检索页面,在这种情况下,服务器是在我的笔记本电脑上运行的开发 Django 服务器。
【问题讨论】:
标签: django http http-headers request-headers response-headers