作者:虚假爱情2502873563_918 | 来源:互联网 | 2023-07-19 11:43
服务器是nginx的,配置了下面这段代码:
1 2 3 4 5
| location ~* \.(css|js|apk)$ {
root /usr/local/resources;
expires 12h;
} |
用chrome访问可以看到js与css都是
与
,然后状态都是
。50个请求,1.03秒, 17kb
用firefox访问js与css同样50个请求,但响应是3.x秒2.x秒甚至4.x秒。返回的状态是
,没有像chrome那样读取缓存。返回的内容有1.87MB,每次都是这样
firefox请求头
1 2 3 4 5 6 7 8 9 10
| Accept: text/css,*/*;q=0.1
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Cache-Control: max-age=0
Connection: keep-alive
COOKIE: ID=d450d6f9-434b-4…031709a|1548209034|1548208680
Host: x.xxxx.com
If-Modified-Since: Mon, 21 May 2018 01:41:39 GMT
Referer: https://x.xxxx.com/index.html
User-Agent: Mozilla/5.0 (Macintosh; Intel …) Gecko/20100101 Firefox/57.0 |
firefox响应
1 2 3 4 5 6 7 8
| cache-control: max-age=864000
date: Wed, 23 Jan 2019 02:03:54 GMT
etag: "5b0223d3-37e2"
expires: Sat, 02 Feb 2019 02:03:54 GMT
last-modified: Mon, 21 May 2018 01:41:39 GMT
server: Tengine
set-COOKIE: SERVERID=3e75f47fc0404902213b8…|1548209034|1548208680;Path=/
X-Firefox-Spdy: h2 |
请问firefox需要设置什么吗? 还是代码有问题?