Commit 032b87dc authored by Vincent Pelletier's avatar Vincent Pelletier

ERP5Form: Do not bump field cache cookie on each miss.

On sites with more than one Zope, this code was causing the cookie to be
bumped each time a form is rendered, causing unneeded cache misses and
slight ZODB bloat (estimated around 100B per form view).
parent c080221c
......@@ -74,7 +74,7 @@ class FieldValueCacheDict(dict):
if cookie != self._last_sync:
LOG("ERP5Form.Form", 0, "Resetting form field value cache")
self._last_sync = cookie
self.clear()
super(FieldValueCacheDict, self).clear()
raise KeyError('Field cache is outdated and has been reset')
return super(FieldValueCacheDict, self).__getitem__(cache_id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment