Cache headers
Checks Cache-Control, ETag and Expires response headers.
¿Por qué importa esto?
Good cache headers ensure browsers store static files and don't need to re-download them on every visit. This dramatically speeds up returning visitors and reduces server load.
¿Cómo se soluciona?
Set Cache-Control: max-age=31536000 for static files (CSS, JS, images). Use ETag for dynamic pages. Add Vary: Accept-Encoding for compressed responses.
Este check puntúa de 0 a 100. Bajo 50 es un fallo, 50 a 89 un aviso, 90 o más es bueno. Tras cada crawl ve la nota por página en el informe, con una breve explicación.
Preguntas frecuentes
Checks Cache-Control, ETag and Expires response headers.
Good cache headers ensure browsers store static files and don't need to re-download them on every visit. This dramatically speeds up returning visitors and reduces server load.
Set Cache-Control: max-age=31536000 for static files (CSS, JS, images). Use ETag for dynamic pages. Add Vary: Accept-Encoding for compressed responses.
Ejemplo
Copie el código de abajo y adapte el dominio, la marca y el contenido a su situación.
# Nginx: cache headers for static files
location ~* \.(css|js|woff2|png|jpg|webp|avif|ico)$ {
expires 1y;
add_header Cache-Control "public, max-age=31536000, immutable";
}
# HTML pages: no caching (or short TTL)
location ~* \.html$ {
add_header Cache-Control "no-cache, must-revalidate";
}
# Apache .htaccess
<FilesMatch "\.(css|js|woff2|png|jpg|webp)$">
Header set Cache-Control "public, max-age=31536000, immutable"
</FilesMatch>