¿Odias los anuncios? Ir Sin publicidad Hoy

Calculadora de TTL de caché HTTP / max-age

DatosDesarrollador
ANUNCIO PUBLICITARIO · ¿ELIMINAR?

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

ANUNCIO PUBLICITARIO · ¿ELIMINAR?

Guía

HTTP Cache TTL / max-age Calculator

Calculadora de TTL de caché HTTP / 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.

Cómo utilizar

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.

Características

  • 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).
  • Generación en Tiempo Real – Header string updates instantly as you toggle any directive or change any value.

Cuándo utilizar esta herramienta

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.

ANUNCIO PUBLICITARIO · ¿ELIMINAR?

Preguntas frecuentes

  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.

¿Quieres eliminar publicidad? Adiós publicidad hoy

Instalar extensiones

Agregue herramientas IO a su navegador favorito para obtener acceso instantáneo y búsquedas más rápidas

añadir Extensión de Chrome añadir Extensión de borde añadir Extensión de Firefox añadir Extensión de Opera

¡El marcador ha llegado!

Marcador es una forma divertida de llevar un registro de tus juegos, todos los datos se almacenan en tu navegador. ¡Próximamente habrá más funciones!

ANUNCIO PUBLICITARIO · ¿ELIMINAR?
ANUNCIO PUBLICITARIO · ¿ELIMINAR?
ANUNCIO PUBLICITARIO · ¿ELIMINAR?

Noticias Aspectos técnicos clave

Involucrarse

Ayúdanos a seguir brindando valiosas herramientas gratuitas

Invítame a un café
ANUNCIO PUBLICITARIO · ¿ELIMINAR?