OpenTreeMap/OTM2 — pull request #1362 by maurizi (2014-05-09 21:33:08+00:00)
Title: Performance enhancements

After some investigation, it seems like the biggest culprit for slowness on the plot detail page is `form_extras.py`.

Specifically, it makes a set of requests for every field on the page for:
- The instance user
- The instance user's role
- The field permissions for the instance user

It seems like these could be easily stored in a thread local cache, as there isn't a scenario where these will be changed during the course of handling the request that we would _want_ to capture.

This PR brings in [Johnny Cache](https://github.com/jmoiron/johnny-cache), which provides a generic QuerySet caching, using Redis as the backend. Just using johnny-cache gives a x4 speed improvement when the cache is warmed up.
It also provides a thread local storage cache, which is invalidated at the end of every request, which we can use for further manual caching.