Hacker News new | ask | show | jobs
by loyukfai 1704 days ago
Any similar caching plugin would you recommend instead?
8 comments

My first recommendation would be to question whether you even need a caching plugin. I'd recommend a benchmark. PHP today is much faster than it used to be, and in many cases caching plugins have been written with old, slow PHP in mind.

Pro tip: If you have trouble measuring the effect of your caching plugin, it probably means its effect is neglegible.

If you really feel you need a caching plugin, WP Super Cache is written by the company that also writes Wordpress. I'd consider that the most trustworthy.

Yeah, if you're on cheap shared hosting (which many, many WordPress sites are), then you're going to hit various limits and have your site disabled the day Ahrefs and Majestic 12 both decide to crawl your site the same day.

A properly set up caching plugin basically saves the pages as plain HTML and serve them with mod_rewrite instead of invoking PHP every time. The speed difference for an individual page load might not be that much for a properly optimized site, but the overall resource usage will be much lower.

> The speed difference for an individual page load might not be that much for a properly optimized site, but the overall resource usage will be much lower.

Is that what you believe or do you have benchmark results?

I work helping people set up things like caching. On the three sites I looked at today, caching plugins had an immediate and positive effect.

That serving static files use less resources than firing up PHP should hardly be surprising.

Sure, mod_lsapi and FastCGI are fast, and opcache is a godsend, but static files are still going to be faster than doing multiple MySQL queries, triggering plugins, rendering the HTML, doing whatever post-processing the plugins do, and then serving the result.

Caching is a must on WordPress. The first distributed password bruteforce (of which there will be many) will drive the load on your server into 3 digits in short notice otherwise.

Source: hoster

How does a cache help when you have a distributed password bruteforce?
The bottleneck is MySQL. At some point you'll need a caching plugin, even a simple one. One of the problems, in general, with the WordPress ecosystem is the bloat.
Can't you just use Varnish?
Of course.

You can also write a minimal cache system in just ~2/300 lines of PHP that is still very efficient. So efficient you can even survive a hug of death from HN on a tiny VPS without a blink. I did it.

Yet, people seems so attracted to those bloated "fastest" plugins...

For logged out users, sure (I did). If your users are logged in or you need to process their visit server side, it's a bit harder. AFAIK you can't do fragmented caching with vanilla Varnish.
Side note: To my knowledge the only plugin that supports fragmented caching (specific non-cached portions of PHP) is W3 Total Cache.
> My first recommendation would be to question whether you even need a caching plugin.

My first question to you would be "Why wouldn't you bypass PHP and MySQL if you can?".

For some really basic site sure, you can go without caching, but for any reasonable degree of complexity not using caching is a foolish waste of hardware and end-user patience since we can be talking TTFB of 100-200 ms vs up to seconds.

https://www.cloudflare.com/en-gb/automatic-platform-optimiza...

The closest thing you'll get to serverless wordpress in one click. There is no wordpress caching plug-in I am aware of that will get you anywhere near.

I don't understand why people are trusting random WP contrib developers with cache anyhow? Is nginx no longer a thing?
Because a lot of people who run successful WordPress sites have zero systems admin or developer skills at all. They are usually good writers instead.
Configurablity and ease of use. Many people run Wordpress on cheap, shared hosting and would only have the option of a cache plugin. A lot of WP admins likewise have no command-line experience and couldn’t install nginx without resorting to Google.
Caching plugin for wordpress still has benefit that nginx cannot provide like providing object caching, etc.
WP admins don't have much control (granularity) over the nginx cache. The options I've seen simply have a single "Purge" button.
WP Rocket is pretty nice but it's a paid plugin
Can vouch for WP Rocket. We've tried multiple plugins for our blog[1] and it is by far the most reliable.

1: https://www.taskade.com/blog

wp-supercache - it's been taken over by automaticc themselves these days, which is an added bonus.
Personally I always go with Cache Enabler (by KeyCDN) with nginx. Simple and rock solid. Creates static HTML. For optimum performance (bypassing PHP altogether) configure nginx to try_files (or equivalent in Apache) in the wp-content/cache directory.

Edit: I've also used WP Super Cache and W3 Total Cache quite extensively, both both of these have on some sites had a tendency to randomly clear the cache and I've never managed to figure out why. Cache Enabler has never done this.

W3 Total Cache if you're on shared hosting.
Hummingbird