[Erp5-report] r29013 - /erp5/trunk/products/ERP5Type/CachePlugins/DistributedRamCache.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Sep 14 10:26:40 CEST 2009


Author: nicolas
Date: Mon Sep 14 10:26:37 2009
New Revision: 29013

URL: http://svn.erp5.org?rev=29013&view=rev
Log:
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

Modified:
    erp5/trunk/products/ERP5Type/CachePlugins/DistributedRamCache.py

Modified: erp5/trunk/products/ERP5Type/CachePlugins/DistributedRamCache.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/CachePlugins/DistributedRamCache.py?rev=29013&r1=29012&r2=29013&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/CachePlugins/DistributedRamCache.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/CachePlugins/DistributedRamCache.py [utf8] Mon Sep 14 10:26:37 2009
@@ -36,7 +36,7 @@
 from BaseCache import CacheEntry
 from Products.ERP5Type import interfaces
 import zope.interface
-from binascii import b2a_hex
+from base64 import encodestring
 
 try:
   import memcache
@@ -112,7 +112,7 @@
     # Escape key to normalise some chars
     # which are not allowed by memcached
     # Could reach the limit of max_key_len
-    cache_id = b2a_hex(cache_id)
+    cache_id = encodestring(cache_id).replace('\n', '')
     return cache_id
 
   def get(self, cache_id, scope, default=_MARKER):




More information about the Erp5-report mailing list