Skip to main content

import_best_memcache

Attempts to import and cache the most suitable memcache library available, prioritizing pylibmc over the standard memcache package, and raises an ImproperlyConfigured error if neither is found.

def import_best_memcache() - > tuple

Attempts to import and cache the most efficient available memcached library, prioritizing 'pylibmc' over the standard 'memcache' package.

Returns

TypeDescription
tupleA tuple containing a boolean indicating if pylibmc is used, the imported memcache module, and a key transformation function.