Server {Listen80; server_name tirion.me www.tirion.me; # Note that these lines is originally from the"Location/"Block Root/home/www/wordpress;index index.php index.html index.htm; Location/{try_files $uri $uri/=404; } error_page404/404.html; Error_page 502 503 504/50x.html; Location =/50x.html {root/usr/share/nginx/html; } Location~\.php$ {try_files $uri=404; Fastcgi_pass Unix:/var/run/php-fpm/php-Fpm.sock; Fastcgi_index index.php; Fastcgi_param script_filename $document _root$fastcgi_script_name; Include Fastcgi_params; # config HTTP strong cache static file, return to location via Response header~ .*\. (gif|jpg|jpeg|png|bmp|swf|js|CSS) $ {expires 3d; }}
The Response header informs the browser to cache the Gif|jpg|jpeg|png|bmp|swf|js|css file for 3 days
After browser access, you can see it in the Response Header.
cache-control:max-age=31536000 These files are not re-fetched from the server, but are fetched directly from the browser's cache, improving network performance.
Nginx Config HTTP strong cache