# comment # useful if you statically generate your website #location ~* \.(html|pdf)$ { # # cache documents for a day # add_header Cache-Control "public, max-age=86400"; #} location ~* \.(js|css|txt)$ { # cache static-assets for a week add_header Cache-Control "public, max-age=604800"; } location ~* \.(png|jpg|jpeg|gif|ico|svg)$ { # cache images for a month add_header Cache-Control "public, max-age=2592000"; } location ~* \.(ttf|otf|eot|woff|woff2)$ { # cache fonts for a year add_header Cache-Control "public, max-age=31536000"; }