Every single request hits RootController.__init__
and does a neighborhood lookup. Neighborhoods don't change very often so this could be cached in-memory for a short time. I think the duration should be configurable and default to 0 (particularly so development is easy). Based on some performance monitoring I did, this may save up to 15% of time spent in a simple request (smaller relative % on more complex pages)
Closed #721.
ib/7824
Some timings of neighborhood lookup. First hit - after server restart.
Before cache:
After cache:
QA:
neighborhood.cache.duration = 60
to config/adobe/admin/
, make sure you see 'Adobe' at the top of the pagemongo pyforge
db.neighborhood.update({'url_prefix': '/adobe/'}, {'$set': {'name': 'Adobe 1'}})
+1 except for a minor issue: when I changed the name and it was still cached /p/test/blog/ would redirect to /p/test I added a commit to
ib/7824
with a fix and full explanation. If you're good with that, go ahead and merge & close. The caching looks good to me.