articlemetrics/lagotto — pull request #103 by mfenner (2014-09-13 19:07:26+00:00)
Title: Moved caching of admin panel to model caching

Updated caching in the admin panel. Moved from view caching in Rabl to model caching because:

* we need to warm the cache, and writing to the Rails cache directly is faster and more flexible than via API call
* we only want to cache some attributes (those that require slow SQL queries)

One important fix is to update the cache_key only when all cached attributes are updated so that we don't have an invalid cache during the time it takes to update the cache.