Commit 6c18e27f authored by Nicolas Delaby's avatar Nicolas Delaby

Base64 escaping format is better candidate than b2a_hex, because escaping...

Base64 escaping format is better candidate than b2a_hex, because escaping value is lower sized. But it introduce some newlines which can be safely removed

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29013 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 539e4ea6
...@@ -36,7 +36,7 @@ from BaseCache import BaseCache ...@@ -36,7 +36,7 @@ from BaseCache import BaseCache
from BaseCache import CacheEntry from BaseCache import CacheEntry
from Products.ERP5Type import interfaces from Products.ERP5Type import interfaces
import zope.interface import zope.interface
from binascii import b2a_hex from base64 import encodestring
try: try:
import memcache import memcache
...@@ -112,7 +112,7 @@ class DistributedRamCache(BaseCache): ...@@ -112,7 +112,7 @@ class DistributedRamCache(BaseCache):
# Escape key to normalise some chars # Escape key to normalise some chars
# which are not allowed by memcached # which are not allowed by memcached
# Could reach the limit of max_key_len # Could reach the limit of max_key_len
cache_id = b2a_hex(cache_id) cache_id = encodestring(cache_id).replace('\n', '')
return cache_id return cache_id
def get(self, cache_id, scope, default=_MARKER): def get(self, cache_id, scope, default=_MARKER):
......
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