以下是请求标头:
GET /url/ HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
DNT: 1
Cookie: data=ABC;
Connection: keep-alive
Cache-Control: max-age=0
以下是来自服务器的回复:
HTTP/1.1 200 OK
Date: Fri, 11 Oct 2013 23:28:32 GMT
Server: Apache/2.2.14 (Ubuntu)
X-Powered-By: PHP/5.3.2-1ubuntu4.18
Expires: Wed, 16 Oct 2013 03:28:32 GMT
Cache-Control: max-age=360000
Pragma: cache
Content-Language: en
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 844
Keep-Alive: timeout=15, max=92
Connection: Keep-Alive
无论我刷新页面多少次,无论如何,它总是发出请求(因为它通过HTTPS需要200ms +)。我在监督什么吗?响应标头是否应包含更多参数以防止Firefox发出服务器请求?
答案 0 :(得分:0)
我通常会添加example.com/url/?nocache=<?php echo rand(); ?>
这样的内容,它会在网址中添加一个随机数,每次都会使其成为一个不同的网址,以防止缓存。