4 ms·
Out of curiosity: how does people using Wordpress [at somewhat scale] handle layers of cache? Last I used it, relying on the Wordpress cache layer just didn't c
by jbergstroem 9y ago
Out of curiosity: how does people using Wordpress [at somewhat scale] handle layers of cache? Last I used it, relying on the Wordpress cache layer just didn't cover enough cases. The MySQL one "saved" me seeing how Wordpress likes to ask the same question. A lot.
- sciurus 9y agoPrimarily by putting a caching proxy server like Varnish in front of Wordpress.
- agrajag 9y agoYep, this is what we do. Adding in some kind of object cache cluster wasn't a significant enough of an improvement over just hitting mysql to justify the extra point of failure. The problem is WP just makes a ton of simple queries - in any complex install the bottleneck is probably going to be network latency to the database.
- morgo 9y agoI think this echo's Rene's point about moving the cache closer to the application as well. I have some hypothetical numbers illustrating the impact of network latency: http://www.tocker.ca/2013/11/18/how-important-is-it-to-merge-queries-together.html http://www.tocker.ca/2013/11/18/how-important-is-it-to-merge... The simple queries are basically free once they get to MySQL. Query cache does not help.
- Viper007Bond 9y agoIf you enable WordPress's object cache, it should get most page views down to a couple or even zero queries. It's poorly written themes and plugins where problems can arise. The easy solution is to just enable full page caching. On single server setups, something like WP Super Cache works well. On distributed setups like WordPress.com, this is more appropriate: https://github.com/Automattic/batcache https://github.com/Automattic/batcache
- tyingq 9y agoThe object cache doesn't persist across HTTP requests. You have to install some 3rd party plugin for that.[1] [1]https://codex.wordpress.org/Class_Reference/WP_Object_Cache https://codex.wordpress.org/Class_Reference/WP_Object_Cache
- Viper007Bond 9y agoCorrect, which is what I meant by enabling it. Apologies for not being clearer. It used to persistent via writing objects to the filesystem but it actually ended up being _slower_ in some configurations.
- munchai 9y agoHaving an object cache is one layer. However, caching SQL in conjunction could speed up application response times, depending on the behavior of the workload. I have seen the performance increase by 4x by caching SQL.