How to prevent/delay MySQL connections when an object cache is used?

I’m currently dealing with a site using W3TC plugin and that plugin seems to provide a custom database handler which actually caches queries to memcache. Give that a try.

Sidenote: Just make sure, in case you are using multiple production servers, to use a shared memcache server and that you don’t cache those queries on local memcache server (that’s what my site is doing and you’ll agree that it is not clever).

Further, I don’t think that trying to reproduce MySQL query cache in memcache is a good idea. MySQL database handles query cache by default and it’s performant enough.

What I’d do is a page level cache for non logged users. If you’ll serve generated HTML from memcache rather than trying to build the output from scratch every time, despite it’s object cached, you’ll save even that mysql connection as there is no server side work required.

I’m not a fan of W3TC, but in this case, that plugin can provide you with page level cache as well.