広告が嫌いですか? 行く 広告なし 今日

HTTPキャッシュTTL / max-age計算ツール

データ開発者
広告 ・ 取り除く?

Cache Scope

Caching Behavior

Time-to-Live (TTL)

How long the browser can cache the response
How long shared/CDN caches can store the response
Serve stale while fetching fresh response in background
Serve stale response if origin returns an error

CDN-Specific Headers

広告 ・ 取り除く?

ガイド

HTTP Cache TTL / max-age Calculator

HTTPキャッシュTTL / max-age計算ツール

Build HTTP Cache-Control headers visually. Select a caching strategy preset or configure individual directives — max-age, s-maxage, stale-while-revalidate, immutable, and more. Get a ready-to-use header string with human-readable explanations and CDN-specific equivalents.

使い方

Choose a strategy preset (Static Assets, HTML Pages, API Responses, CDN Edge Cache) to auto-fill common configurations, or use Custom mode to build your header from scratch. Toggle directives, set time values for max-age and s-maxage, and the complete Cache-Control header string generates instantly. Copy it directly into your server configuration, .htaccess, or application code.

特徴

  • Strategy Presets – Pre-configured settings for common scenarios: static assets (1 year, immutable), HTML pages (revalidate every request), API responses (private, no-cache), and CDN edge caching.
  • All Cache-Control Directives – Configure public, private, no-cache, no-store, max-age, s-maxage, stale-while-revalidate, stale-if-error, must-revalidate, proxy-revalidate, no-transform, and immutable.
  • Conflict Detection – Warns when you select conflicting directives like no-store with max-age, or public with private simultaneously.
  • Human-Readable Time Display – Automatically converts seconds to readable format (86400 seconds = 1 day) next to every time input.
  • Header Explanation – Shows a plain-English explanation of what your configured header actually does.
  • CDN-Specific Headers – Generates equivalent headers for Cloudflare (CDN-Cache-Control), Varnish/Fastly (Surrogate-Control).
  • リアルタイム生成 – Header string updates instantly as you toggle any directive or change any value.

このツールを使用するタイミング

Use this tool when configuring caching for web applications, setting up CDN cache policies, optimizing static asset delivery, or debugging cache behavior. It’s essential for web developers, DevOps engineers, and anyone working with HTTP caching who needs to build correct Cache-Control headers without memorizing the RFC 7234 specification.

広告 ・ 取り除く?

よくある質問

  1. What is the Cache-Control header?

    Cache-Control is an HTTP header that tells browsers and CDNs how to cache a response. It controls whether a response can be cached (public vs private), how long it can be cached (max-age in seconds), whether it must be revalidated before use (no-cache, must-revalidate), and whether it should never be stored at all (no-store). Getting Cache-Control right is one of the most impactful web performance optimizations available.

  2. What is the difference between max-age and s-maxage?

    max-age sets the cache lifetime for all caches — both browser caches and shared (CDN/proxy) caches. s-maxage (shared max-age) overrides max-age specifically for shared caches like CDNs and proxy servers, while browsers still use max-age. This lets you set different cache durations: for example, max-age=60 (browser caches for 1 minute) with s-maxage=86400 (CDN caches for 1 day). This is a common pattern for content that changes occasionally.

  3. What does stale-while-revalidate do?

    stale-while-revalidate allows caches to serve a stale (expired) response while simultaneously fetching a fresh one in the background. For example, stale-while-revalidate=86400 means the cache can serve an expired response for up to 1 day while it revalidates asynchronously. This dramatically improves perceived performance because users never wait for revalidation — they get an instant (slightly stale) response while the cache updates itself for the next request.

  4. What is the difference between no-cache and no-store?

    no-cache does NOT mean 'don't cache.' It means 'cache the response, but always revalidate with the server before using it.' The browser stores the response but checks with the server (via ETag or Last-Modified) before serving it — if the content hasn't changed, the server responds with 304 Not Modified and the cached version is used. no-store means 'don't cache at all' — the response must never be stored by any cache. Use no-cache for content that might change but benefits from conditional requests; use no-store for sensitive data that should never be persisted.

広告なしで楽しみたいですか? 今すぐ広告なしで

拡張機能をインストールする

お気に入りのブラウザにIOツールを追加して、すぐにアクセスし、検索を高速化します。

に追加 Chrome拡張機能 に追加 エッジ拡張 に追加 Firefox 拡張機能 に追加 Opera 拡張機能

スコアボードが到着しました!

スコアボード ゲームを追跡する楽しい方法です。すべてのデータはブラウザに保存されます。さらに多くの機能がまもなく登場します!

広告 ・ 取り除く?
広告 ・ 取り除く?
広告 ・ 取り除く?

ニュースコーナー 技術ハイライト付き

参加する

価値ある無料ツールの提供を継続するためにご協力ください

コーヒーを買って
広告 ・ 取り除く?