网页调试技巧
# html页面强制刷新,清缓存
在html页面头部添加
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
1
2
3
4
5
6
2
3
4
5
6
EventSource 本地调试成功,线上环境不响应
原因是nginx默认开启的buffer机制缓存了服务器推送的片段信息,缓存达到一定的量才会返回响应内容。只要关闭proxy_buffering即可。配置如下所示:
server {
listen 80;
server_name www.test.company.com;
location / {
proxy_pass http://localhost:8080;
proxy_buffering off;
}
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
上次更新: 2023/05/07, 23:16:56