PageRule → Cache Rules
Cache Rules
Cloudflare のキャッシュ設定をカスタマイズします。キャッシュの対象、キャッシュする期間、場所を調整できるほか、一致するリクエストに対して Cloudflare のキャッシュやその他のルール製品との特定のやり取りをトリガーできます。
過去のアップした以下の記事は今後Cache Rulesで設定すべき内容となります。
Page Rules のリタイアメントと新しいルールへの自動移行について 2024
https://developers.cloudflare.com/rules/reference/page-rules-migration/
Cache Rules
ルール1によりルート(つまりデフォルトindex.html)以外の全てのコンテンツをキャッシュ対象として指定します。念のためルール2で、ルート(index.html)を明示的に除外します。ちなみにルール2が無くても動作しますが、除外したいものは明示的に設定しておいた方がわかりやすいかな?ぐらいです。
Cache Rules と Cache Status のREVALIDATED について 2024
For conflicting settings (for example, bypass cache versus eligible for cache), the last matching rule wins. For example, if cache rule #1 is set to cache everything on example.com/images and cache rule #2 is set to bypass cache on example.com, then cache will be bypassed for all URLs that match example.com, since rule #2 is the last matching rule.
https://developers.cloudflare.com/cache/how-to/cache-rules/order/
競合する設定の場合、最後に一致したルールが優先される
https://blog.cloudflare.com/ja-jp/cache-rules-go-ga/
Cloudflareで個人情報を取り扱うページのキャッシュ除外は可能? – Cloudflare(クラウドフレア)代理店 株式会社ドーモ 2023
URI Path end with /
And
URI Path does not start with /wp-
And
Cookie does not contain wordpress_logged_inhttps://community.cloudflare.com/t/cache-rules-and-best-practise-for-wordpress/541912/4
Ingnore query string
Ingnore query string の設定変更はEnterprise Planが必要
Cache Default File Extensions のテンプレートでもデフォルトオフ 2024/1
使ってみる
Cache Default File Extensions → デフォルトのルールを Cache Rules で実装
(http.request.full_uri eq "https://example.com/") だと HTTP_HOST ヘッダがオリジンにこない?
(http.host eq "example.com" and http.request.uri.path eq "/") だと HTTP_HOST ヘッダあり