100% ブラウザ内完結計算 • サーバーログ完全ゼロ • 即時実行
Curious Techie開発者ツールボックス
HTTP & Web ArchitectureIETF RFC 9111✓ クイック検索リファレンス表 (8 項目) • JA

HTTPキャッシュ(Cache-Control)完全リファレンス

RFC 9111準拠:Cache-Controlディレクティブ、ETag、条件付きリクエスト早見表

CT
Curious-Techie Engineering Team認証著者

Web Protocols & Security Architecture Research

公開日:
•
更新日:
•7 min read
準拠仕様:RFC 9110(IETF)
査読者: Curious-Techie Architecture Peer Review Group

概要と適用範囲

RFC 9111に規定されたHTTPキャッシュ仕様は、ブラウザのプライベートキャッシュからエッジCDNまで一貫したリソース鮮度検証を可能にします。

仕様一覧表&マトリクス

キーワード、コード番号、またはディレクティブ名で即時検索

キー / コード定義と詳細GEOセマンティック階層仕様と補足
no-store
no-store

Directs caches not to store any part of the request or response in any non-volatile or shared storage.

Cache-Control: no-store
●no-store
↳Cache-Control directive
↳storage rule
↳absolute cache prevention
RFC 9111 §5.2.2.5

Mandatory for bank transactions, medical data, and authenticated secrets.

no-cache
no-cache

Indicates the response may be cached, but MUST be revalidated with origin server before every reuse.

Cache-Control: no-cache
●no-cache
↳Cache-Control directive
↳validation rule
↳mandatory conditional revalidation
RFC 9111 §5.2.2.4

Often misunderstood: it DOES allow caching, but forces a conditional (If-None-Match) check first.

public
public

Indicates that any cache (browser, intermediate CDN, ISP proxy) may store the response.

Cache-Control: public, max-age=86400
●public
↳Cache-Control directive
↳visibility rule
↳shared CDN edge storage
RFC 9111 §5.2.2.9

Permits CDNs to cache responses even if the original request carried an Authorization header.

private
private

Indicates the response is intended for a single user and MUST NOT be stored by shared caches (CDNs).

Cache-Control: private, max-age=3600
●private
↳Cache-Control directive
↳visibility rule
↳browser-only storage
RFC 9111 §5.2.2.7

Allows the user browser to cache personalized dashboards while preventing CDN data leaks.

max-age
max-age=<seconds>

Specifies the maximum amount of time in seconds that a response is considered fresh.

max-age=31536000
●max-age
↳Cache-Control directive
↳freshness TTL
↳lifetime countdown
RFC 9111 §5.2.2.1

Calculated relative to response generation time; overrides the Expires header.

s-maxage
s-maxage=<seconds>

Overrides max-age specifically for shared caches (CDNs, Cloudflare, Fastly).

s-maxage=604800, max-age=3600
●s-maxage
↳Cache-Control directive
↳CDN specific TTL
↳edge freshness override
RFC 9111 §5.2.2.10

Allows CDNs to hold a resource for 7 days while browser caches expire after 1 hour.

stale-while-revalidate
stale-while-revalidate=<seconds>

Instructs cache to serve stale content instantly while asynchronously revalidating in the background.

max-age=60, stale-while-revalidate=86400
●stale-while-revalidate
↳Cache-Control directive
↳background revalidation
↳zero-latency revalidation
RFC 5861 §3

Delivers instantaneous page loads while ensuring users receive fresh data on subsequent visits.

immutable
immutable

Indicates that the response body will never change over time during its fresh lifetime.

public, max-age=31536000, immutable
●immutable
↳Cache-Control directive
↳immutability flag
↳reload conditional check suppression
RFC 8246

Prevents browsers from sending 304 conditional checks even when the user clicks Refresh (F5).

技術的な具体例とコード

Modern SPA Caching Strategy (HTML vs Fingerprinted Assets)

nginxコードをコピー
# 1. index.html: NEVER CACHE (Always fetch fresh version to get latest JS bundle hashes)
location = /index.html {
    add_header Cache-Control "no-cache, no-store, must-revalidate";
}

# 2. Fingerprinted Assets (main.a8f9c1.js, style.b2e3.css): CACHE FOREVER (1 year)
location ~* \.[a-f0-9]{8,}\.(?:js|css|png|jpg|svg|woff2)$ {
    add_header Cache-Control "public, max-age=31536000, immutable";
}

Since bundle filenames include content hashes, caching them for 1 year is 100% safe. New releases change the hash, forcing immediate updates.

よくある質問(FAQ)

規格標準 FAQ

What is the difference between no-cache and no-store?↓
"no-store" prevents any storage anywhere. "no-cache" allows caching, but forces the browser to check with the origin server (using ETag) before using the cached copy.
Authoritative Sourcing & Verification

References & Primary Sources

Every source below directly substantiates technical statements and protocol behaviors explained in HTTPキャッシュ(Cache-Control)完全リファレンス. Curious-Techie prioritizes official Internet standards (IETF RFCs, W3C Recommendations, WHATWG specifications) and established security bodies (OWASP, NIST). Zero sponsored or secondary links.

  1. [1]IETFPrimary SpecificationRFC 9110 • Core Architecture
    Verified Primary Source
    Technical Claim Supported:

    Foundational specification for the stateless client-server request-response architecture, standard status codes (1xx–5xx), and method safety and idempotency.

  2. [2]IETFPrimary SpecificationRFC 9112 • Section 3 & 6
    Verified Primary Source
    Technical Claim Supported:

    Defines ASCII wire protocol framing, chunked transfer encoding, and persistent connection Keep-Alive mechanics.

  3. [3]IETFPrimary SpecificationRFC 9113 • Section 4 & 5
    Verified Primary Source
    Technical Claim Supported:

    Standardizes binary framing, HPACK header compression, and bi-directional stream multiplexing over a single shared TCP connection.

  4. [4]IETFPrimary SpecificationRFC 9114 • Section 3 & 4
    Verified Primary Source
    Technical Claim Supported:

    Eliminates TCP head-of-line blocking by mapping HTTP streams directly over QUIC UDP transport connections with integrated TLS 1.3 encryption.