# Static Asset Caching # Include with: include snippets/cache-static.conf; # Cache static assets for 1 year (use with versioned/hashed filenames) location ~* \.(jpg|jpeg|png|gif|ico|svg|webp)$ { expires 1y; add_header Cache-Control "public, immutable"; access_log off; } location ~* \.(css|js)$ { expires 1y; add_header Cache-Control "public, immutable"; access_log off; } location ~* \.(woff|woff2|ttf|eot|otf)$ { expires 1y; add_header Cache-Control "public, immutable"; access_log off; } # Media files location ~* \.(mp4|webm|ogg|mp3|wav)$ { expires 30d; add_header Cache-Control "public"; access_log off; }