Caching helper function used in zope/plone projects