server
ディレクティブに以下を追加
nginx.conf
add_header X-Cache-Status $upstream_cache_status;
キャッシュヒットしてる時は X-Cache-Status
ヘッダとして HIT
、キャッシュヒットしてない時は MISS
が返ってくる
$ wget -S --spider https://lets.ninja/
Spider mode enabled. Check if remote file exists.
--2016-06-20 20:02:13-- https://lets.ninja/
Resolving lets.ninja... 54.92.34.103
Connecting to lets.ninja|54.92.34.103|:443... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 20 Jun 2016 11:02:13 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
X-Cached: Mon, 20 Jun 2016 08:40:33 GMT
X-Cache-Status: HIT
Length: unspecified [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.