I'm looking for a simple #Wordpress Cache plugin but after staring at the dozens of available candidates, I must admit I have no idea where to turn. I don't need an All-in-One SEO/PageSpeed/etc..., I just need a simple server-side cache that I can set up and forget. Memcached support is a plus as it's already available on my machine.
Any recommendation?
Any recommendation?
Sherri W (SyntaxSeed)
•Hypolite Petovan likes this.
John Wilker 👨🏽💻
•Hypolite Petovan likes this.
Shiri Bailem
•If it's the one I remember, it stores all the cached files in a directory that mirrors the layout of your site, so you can have your server check for the static file before passing off to php.
Hypolite Petovan likes this.
Holly Schilling
•Hypolite Petovan likes this.
Hypolite Petovan
•Holly Schilling
•Hypolite Petovan likes this.
Hypolite Petovan
•Holly Schilling
•Hypolite Petovan likes this.
Shiri Bailem
•A generic cache is only really good for high traffic (ie. the same thing being loaded over and over again within the same few minutes).
You'd want a smarter cache, I wish I remembered the specifics from way back when I worked at Rackspace, but the caching plugin we used was great for making static assets out of dynamic pages so your server could share them quickly without the bog of php.
Also, if you're not already, definitely recommend php-fpm.
Holly Schilling
•The advantage of having the Caching layer in front of the WordPress box is that it separates the caching config/performance from that of the content. It also allows multiple cache boxes to be behind a load balancer, all fed by the same content box.
Shiri Bailem
•We set up a primary server with nginx and php-fpm, and a caching addon (iirc it was WP Super Cache) that cached a static copy of the site like you described. Nginx had a rule that basically checked if you were logged in, and if so it bypassed the cache files, otherwise it just served static content.
We then used lsyncd to mirror the site and cache files over to however many secondary servers we were using. All of those were set to server the static content and only send to the primary when you were logged in or it didn't have the file yet.
We then threw a load balancer in front of it, and it was solid as a rock. (There's certainly little config elements that I glossed over, like I remember we also used varnish for in-memory cache)
Holly Schilling
•I mentioned the CDN part only as a benchmark. Things like a JAM stack can scale infidelity on a CDN due to no severe side work. Still, I don’t see much talk about a JAM stack website anymore.
Hypolite Petovan
•I've never made the jump from Apache2 + PHP module to nginx + PHP-FPM in part because I use the Apache2 ITK MPM in order to assign a specific user to each virtual host, and that I've never found a replacement for it. The other part is that I'm utterly unfamiliar with nginx's configuration syntax, and I've never had a professional environment where I would have learned to set it up, so I've chugged along with Apache2.
Shiri Bailem
•The syntax is definitely different, not going to lie there. If you ever do decide to dip your toe in I do recommend hitting up ChatGPT, because it can help you translate your Apache syntax into nginx and explain the differences.
PHP-FPM supports multiple user accounts natively, so that might help. And it's big thing is disconnecting PHP from the webserver. When combined the webserver can only really handle as many requests as it can handle php processes, but when separate the webserver can handle thousands of static requests in addition to p... show more
The syntax is definitely different, not going to lie there. If you ever do decide to dip your toe in I do recommend hitting up ChatGPT, because it can help you translate your Apache syntax into nginx and explain the differences.
PHP-FPM supports multiple user accounts natively, so that might help. And it's big thing is disconnecting PHP from the webserver. When combined the webserver can only really handle as many requests as it can handle php processes, but when separate the webserver can handle thousands of static requests in addition to php.
If you want to replicate what you're describing in nginx + php-fpm, you would have the user accounts in the different php-fpm pools and then you would have the www-data (or whatever webserver user account you're using) added to the groups of each with read-only access to the files.
The reason the cache suggestion I gave makes such a huge difference is because nginx can easily handle tens of thousands, if not hundreds of thousands of requests simultaneously even on low end hardware. So when set up like we were describing before, you would only need enough php threads to really cover your login and the occasional cache miss.
Hypolite Petovan likes this.
Hypolite Petovan
•Hypolite Petovan
•Shiri Bailem likes this.
Shiri Bailem
•Hypolite Petovan likes this.
Morgan Estes
•SQLite Object Cache
WordPress.orgHypolite Petovan likes this.