How To Make WordPress As Fast As Static Site
Long ago, I wrote about migrating from WordPress to Netlify. It turned out I was going back to WordPress until now. Hosting a static site will indeed be much faster than WordPress. However, it’s more difficult to manage compared to WordPress. So, how to make a WordPress as fast as a static site?
Cache plugins that generate static sites of your WordPress site
There are many WordPress plugins which support this. They will save the static site version of your WP site, save it to a folder inside a wp-content folder, then serve it to users when the content is present and valid.
Though this is the easiest way, this is also the most resource-consuming way. The additional plugin will take more disk space, more memory/RAM to process, more processors time, etc.
So if you want to keep the number of your installed WordPress plugins to a minimum, feel free to try the second way below.
Change it to headless WordPress
Once you finished it, you can host it on Netlify. There is also a starter pack for headless WordPress with Gatsby for continuous deployment to Netlify on this Github repository.
If you’re more on the ball as a developer, then you may want to poke around this way. But if you’re not, it’s better to skip this way. Even if you’re curious to try, make sure you did it on a staging server first, and make sure you know what you’re doing.
The advantage is obvious. This way is going to make your WP site as fast as a static site while still allowing you to work through the WordPress admin dashboard to manage the content of the site. You get the best of both sides, which is great.
Set up Cloudflare Static HTML caching
This is what I’ve done on this blog. This way is much easier than the second way with headless WordPress. However, it will make your WordPress site as fast as a static site.
How to do this? Cloudflare does a nice job with this detailed and easy to follow tutorial. Just read and follow it there.
Ideally, you should have a Cloudflare business plan to do this completely. I know it’s expensive. It’s about $200/month.
I use the free plan myself and confirm this works perfectly. The only hassle is when I need to access the WP admin dashboard, I need to turn on the Developer Mode on the Cloudflare dashboard. Once I finished with my changes on the dashboard, I must turn off that Developer Mode and **purge the whole cache. **
So, there are three ways to make a WordPress site as fast as its static site counterparts. For me, I choose the way with Cloudflare static HTML caching.
It’s not as easy as installing WordPress plugin. But it’s not as difficult as setting up a headless WordPress with Gatsby and host it on Netlify. There is no need to install additional plugins on your WordPress site too. I think this should be the best way for most people. Don’t you think?