Skip to content

Commit

Permalink
Fix cache key to require less memory by using hexdigest
Browse files Browse the repository at this point in the history
  • Loading branch information
datakurre committed Aug 17, 2017
1 parent ee2c23c commit 5e36c2a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGES.rst
Expand Up @@ -4,7 +4,10 @@ Changelog
4.1.1 (unreleased)
------------------

- Nothing changed yet.
Bug fixes:

- Fix diazo tile rules cache key to require less memory by using hexdigest
[datakurre]


4.1.0 (2017-08-17)
Expand Down
5 changes: 4 additions & 1 deletion plone/app/blocks/utils.py
Expand Up @@ -353,7 +353,10 @@ def compile_theme(rules_doc, theme_doc=None, css=True,
def cacheKey(func, rules_url, theme_node):
if Globals.DevelopmentMode:
raise DontCache()
return ':'.join([rules_url, html.tostring(theme_node)])
key = md5()
key.update(rules_url)
key.update(html.tostring(theme_node))
return key.hexdigest()


@ram.cache(cacheKey)
Expand Down

0 comments on commit 5e36c2a

Please sign in to comment.