WordPress Caching with Nginx and Redis
eamann.com
eamann.com
“I just feel it’s overused.” — e.g. You wanted to use nginx and Redis, and needed to justify away from the simple solution.
It should be a smell that instead of doing full-page caching in Varnish, you’ve instead rolled your own full-page application layer caching. Varnish handles POSTs, it handles logins (configured via VCL). This solution is a hack. I applaud your performance, but it’s rather nonsensical.
Furthermore, memcached is not difficult to run — it’s a single daemon that requires less setup than Redis! And no persistent storage.
Final note: “Redis is an open source flat file database server – meaning it’s an optimized key value store for your system.” — this is somewhat nonsense. Redis is a fast datastructure-oriented KV store that happens to be able to persist state to disk, but is by no means a ‘flat file database server’ and I’m not sure how that implies that it’s an optimized KV store.
Seems he can accomplish the same with Nginx itself (which he's already using -- though not certain of the details if u are serving PHP via nginx itself too).
There is a place for a Memcached/Redis type role in generating a Wordpress page. Tools like W3 Total cache store certain small elements of the page in Memecached. So, could see Redis being used there. But for blind full page caching, Nginx can do that job.
http://www.mysqlperformanceblog.com/2006/09/27/apc-or-memcac...
In any event, you're much better off doing full-page caching using tools designed for this task, such as Varnish. As a bonus, you get tools such as varnishtop, varnishlog and varnishstat to monitor your cache.
What were the problems you had with Memcached? Assuming you install it from your distro's respositories, you just need to tweak a configuration file with less than 10 options, the most important option being -m. Unlike Redis, Memcached rarely adds exciting new features, so there's little incentive to compile it yourself.
I believe that detecting the prescense of cookies, HTTP methods and and request paramters are all supported using the buitlin "if" block and standard HTTP module variables.
Ubuntu or Debian: apt-get install memcached
OS X: brew install memcached
CentOS/Fedora: yum install memcached
They're both essentially one command to install on popular platforms, and both have extremely simple conf files.
"best of all, it’s open source" -- Open Source should never be the tickbox on a feature set that wins over another product. Look what the product provides now and into the future with the less work -- just because you can change or view the source code doesn't mean it's going to grow with you.