Here is one such effort (shameless plug): https://github.com/stucchio/Guacamole
Here is one such effort (shameless plug): https://github.com/stucchio/Guacamole
Johnny Cache does automatic invalidation, but will invalidate an entire table's cache on one write. If you have a site with a small number of writes, this is an easy and instant win. Setup is under ten lines of configuration.
CacheMachine, on the other hand, tracks the objects that were returned for individual queries. The queries are invalidated when one of the associated objects changes, but not when a new object is added to the db. I believe addons.mozilla.com uses this.
The point of guacamole is that you probably don't want to cache every database read. You probably just want to cache a few models. I.e., if your database has 1 million items (which are frequently updated) and 1000 brands (which are more or less static), you probably want to cache those 1000 brands but not the million items.
Once you've done that, actions like
{% for item in items %}
{{ item.brand.name}}
{% endfor %}
no longer involve sending 50 queries to the db. (Or even to memcached - 50 hits to memcached can still be 25-50ms.)Guacamole doesn't support other cache backends, though that would be pretty easy to add.