Comment on [deleted]
dan@upvote.au 1 month ago
Use a page caching plugin that writes HTML files to disk. I don’t do a lot with WordPress any more, but my preferred one was WP Super Cache. Then, you need to configure Nginx to serve pages directly from disk if they exist. By doing this, page loads don’t need to hit PHP and you effectively get the same performance as if it were a static site.
See how you go with just that, with no other changes. You shouldn’t need FastCGI caching. If you can get most page loads hitting static HTML files, you likely won’t need any other optimizations.
One issue you’ll hit is if there’s any highly dynamic content on the page. You’ll need to use JavaScript to load any dynamic bits.
goldensw@lemmy.dbzer0.com 5 weeks ago
[deleted]dan@upvote.au 5 weeks ago
Since you’re using Hetzner, one option is to get a Hetzner storage box to store the media. 1TB space is $4/month (not sure about EU pricing).
On-disk cache prevents a “thundering herd” problem when you reboot - an in-memory cache would be empty on rebootz whereas an on-disk cache survives a reboot. Linux handles caching files in RAM automatically.
rimu@piefed.social 1 month ago
This is good advise, listen to dan. WP Super Cache is amazing although getting it working just right can take some tweaking.
The Redis Object Cache plugin is worth a try. It’ll only take a minute to set up.
Is it 200k users or 200k page loads? Those are really different as each user will load multiple pages in a month.
goldensw@lemmy.dbzer0.com 5 weeks ago
rimu@piefed.social 5 weeks ago
Oh right, yeah, Wordpress does tend to use up an awful lot of storage - every image gets copied 5 or 6 times, in different sizes just incase you need that size. It’s nuts.
You don’t need to store those images in your server though, they can be uploaded to S3 (object storage) where it is 10x cheaper to store them and then you can have a cheaper VPS.
https://wordpress.org/plugins/amazon-s3-and-cloudfront/
There are many providers of S3-compatible storage, you don’t need to use AWS. Cloudflare R2 is super cheap - https://www.cloudflare.com/en-gb/developer-platform/products/r2/ or Hetzner - https://www.hetzner.com/storage/object-storage/
dan@upvote.au 5 weeks ago
This is heavily dependent on the VPS. Some of my VPSes are cheaper than object storage would be.
goldensw@lemmy.dbzer0.com 5 weeks ago