How to cache a PHP page using Nginx
You find it slightly annoying that a completely static page like this one still causes the web server to run code? You want to shave off a few milliseconds from the page load time? Your page does not have dynamic content for your visitors? You have a static IP address at home? You are okay with slightly hackish solutions that might break spectacularly in the future?
Then this guide is for you! If not there might still be parts you can apply to your website.
Prerequisites
Nginx a website using PHP (you can apply most parts to other sites by replacing fastcgi_ with pr...
Caching
Cache Path First of all we need to create a new cache path. Outside of any server block add the ...
Adding an exception for static IP address
Assuming you have a static IP address you can easly ignore the cache for your visits. Outside of ...