Your cart is currently empty!
WordPress Page Cache
When this WordPress website was just some text and images, I ignored the warnings of there not being a cache for static pages. I talked about moving images to an S3 bucket which mitigated the slowness that I was experiencing. However, once I added the WooCommerce plugin to add a merch shop for this weksite, the EC2 server that was hosting this website just didn’t have the CPU or memory to handle running it. It kept crashing and I had to keep restarting it.
First thing I tried was to expand the memory from 1 to 8GB of memory and from 1 to 2 vCPUs. Crashes went from daily and weekly, but the website was still quite slow. Not only that, costs of running a more powerful server goes way up. I knew I needed to do something otherwise keeping this website running would become unsustainable cost-wise.
Running a WordPress server is nice because it gives you useful warnings in the Health Screen. There was a warning about there not being an page cache. I believed running one would be the best chance of reducing stress on the WordPress server.
And I was right. After adding one, this website started running much more smoothly, and it was super simple to do too.
Go to Plugins > Add New Plugin, type “optimize” and install and activate the WP-Optimize plugins. Go to WP-Optimize > Cache, turn on “Enable page caching”, and click “Save changes” button.
That’s it. It takes less than a minute to do. Honestly I’m surprised that WordPress doesn’t have something like this by default. I will be adding this cache to all of my WordPress websites that I manage. I will also be trying to reduce the resources back to a sustainable cost of 1 GB of memory and 1 CPU to see if it still works.
Update 9/4/2024: While the cached pages work great, dynamic processing such as login still requires more resources. I’ve reduced the resources to 2CPU and 4GB RAM. We’ll see how it runs with that.
Leave a Reply