introduce WP Object Cache
introduce WP Object Cache

Most of our queries are cheap because they fetch single objects via
primary index, especially when using the template API. There’s just a
lot of them, often duplicates _within the same request_.

This change caches all objects that are fetched by ID using the WP
Object Cache. By default it’s non-persistent but since we have a lot of
duplicate requests, it still saves queries.

Magic starts happening once you add persistence. I have memcached
running locally and the effect is very noticable (80%+ db queries saved
on a LNP episode page). It should be noted, though, that WordPress also
makes heavy use of this API, so part of the gain is from WP Core.

This change requires thorough testing, but if I didn’t miss any obvious
flaws in the approach, it should be a huge benefit to everyone, even
without memcached.

Target Release: 2.2

Links:

- WP Object Cache:
https://codex.wordpress.org/Class_Reference/WP_Object_Cache
- Memcached article: http://scotty-t.com/2012/01/20/wordpress-memcached/
- Memcached WP dropin: https://wordpress.org/plugins/memcached/ and
bugfix:
https://wordpress.org/support/topic/fix-for-notice-undefined-offset-1

podlove/podlove-publisher,katrinleinweber/podlove-publisher,podlove/podlove-publisher,katrinleinweber/podlove-publisher,podlove/podlove-publisher,katrinleinweber/podlove-publisher,katrinleinweber/podlove-publisher,podlove/podlove-publisher,podlove/podlove-publisher,noplanman/podlove-publisher,noplanman/podlove-publisher,noplanman/podlove-publisher,katrinleinweber/podlove-publisher,noplanman/podlove-publisher,podlove/podlove-publisher,noplanman/podlove-publisher