0

我已经设置了我的 nginx.conf 文件以使用我在网上找到的教程中的代理缓存。但是,我试图弄清楚如何检查它是否真的有效。我在某处读过添加 add_header X-Cache-Status $upstream_cache_status; 在服务器部分的配置文件中应该添加一个缓存头到一个响应中,该响应将显示它是否来自缓存(具有 HIT、MISS 或 EXPIRED 的值)。但是,我想知道在哪里可以实际查看此标头(及其值),以及这是否是正确的方式/是否还有其他方式。一般来说,我对网络很陌生,如果这是一个菜鸟问题,我很抱歉。谢谢!

4

1 回答 1

0

您有正确的方法,要查看发回的标头,您需要检查您的 http 客户端。显然如何做到这一点,如果你能做到,将取决于你的客户

这里有一些查看标题的简单方法:

1. curl --head http://your-adress
2. wget --server-response http://your-adress
3. in firefox, install the [liveheaders][1] addon,
   go the <url>, rightclick->View page info->headers
4. in opera open dragonfly with ctrl+i
   go to network->make request part of the tool,
   enter http://your-adress, 
   the result with headers will be shown in the response field
于 2012-10-04T20:00:25.200 回答