Una vista rapida a ngx_http_headers_module

Creado: Octubre 8, 2022

El modulo de ngx_http_headers_module nos permite agregar la cabecera de Expires y Cache-Control y otros campos arbitrarios a una cabecera de respuesta.

Para controlar las hojas de estilo, JavaScript, images y otros utilizo el siguiente código:

# Expires map
map $sent_http_content_type $expires {
    default                    off;
    text/css                   30d;
    application/javascript     30d;
    application/font-woff      30d;
    application/font-woff2     30d;
    application/font-ttf       30d;
    font/opentype              30d;
    image/apng                 30d;
    image/avif                 30d;
    image/gif                  30d;
    image/jpeg                 30d;
    image/png                  30d;
    image/svg+xml              30d;
    image/webp                 30d;
}
Leer artículo...