diff --git a/product/ERP5/Extensions/CachePageTemplate.py b/product/ERP5/Extensions/CachePageTemplate.py deleted file mode 100644 index 56e1a94621c6bb0e3157024d968aef9673513919..0000000000000000000000000000000000000000 --- a/product/ERP5/Extensions/CachePageTemplate.py +++ /dev/null @@ -1,34 +0,0 @@ -from Products.ERP5Type.Globals import get_request -import time -from zLOG import LOG - -CACHE_DURATION = 600 - -cached_template = {} -expires_date = {} - -def getCachedPageTemplate(self, id=None, REQUEST=None): - global cached_template - global expires_date - if id is not None: - # Get the user id and request - if not REQUEST: - REQUEST = get_request() - user_id = self.portal_membership.getAuthenticatedMember().getIdOrUserName() - key = (user_id, id) - # lookup the cache for time - now = time.time() - # if cache exists and time is OK, return cache - expires = expires_date.get(key, now) - if expires > now: - LOG('CACHED:',0, str(id)) - return cached_template[key] - # else recompute cache - method = getattr(self, id, None) - if method is not None: - cached_template[key] = method(REQUEST=REQUEST) - expires_date[key] = now + CACHE_DURATION - return cached_template[key] - else: - return '' -