このページの翻訳:
- 日本語 (ja)
- English (en)
最近の更新
- 31 CentOS5 TLS1.2 created
- 2024.04.12 MySQL BIT Field created
- 04 ↷ 50_dialy:2024:04:04 から 50_dialy:2024:04:05 へページを名称変更しました。
最近の更新
文書の過去の版を表示しています。
nginxにはキャッシュ機能としてプロキシキャッシュとFastCGIキャッシュがある。
https://www.rem-system.com/nginx-fastcgi-cache/
fastcgi_cache_path /config/cache/nginx levels=1:2 keys_zone=cache-zone:30m max_size=512M inactive=600m; fastcgi_cache_key "$scheme$request_method$host$request_uri"; set $do_not_cache 0; # -- POST or HEAD ? if ($request_method != "GET") { set $do_not_cache 1; } server { location ~ \.php$ { # -- Login or Comment or Post Editting ? if ($http_cookie ~ ^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$) { set $do_not_cache 1; } fastcgi_cache cache-zone; fastcgi_cache_valid 200 60m; add_header X-F-Cache $upstream_cache_status;
「X-F-Cache」で確認できる。
設定の下記部分
add_header X-F-Cache $upstream_cache_status;
# curl -D - -s -o /dev/null http://localhost/info.php HTTP/1.1 200 OK Server: nginx/1.18.0 Date: Sat, 01 May 2021 13:52:56 GMT Content-Type: text/html; charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive X-Powered-By: PHP/7.4.15 X-F-Cache: MISS
# curl -D - -s -o /dev/null http://localhost/info.php HTTP/1.1 200 OK Server: nginx/1.18.0 Date: Sat, 01 May 2021 13:52:58 GMT Content-Type: text/html; charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive X-Powered-By: PHP/7.4.15 X-F-Cache: HIT