thumbor-memcached provides storages using memcached as a backend.
Before installing, make sure both memcached
and `libmemcached are installed and accessible to python.
$ pip install thumbor-memcached
This config represents the options to store the incoming file.
# MEMCACHED STORAGE OPTIONS
MEMCACHE_STORAGE_SERVERS = ['localhost:5555'] # List of memcached servers to use for keys
STORAGE_EXPIRATION_SECONDS = 120 # Expiration of entries in the memcached storage
Thumbor also allows storing the processed image independent of the incoming image.
MEMCACHE_ITEM_SIZE_MAX = 1048576 # 1024 * 1024 bytes which is the default item_size_max
MEMCACHE_SKIP_STORAGE_EXCEEDING_ITEM_SIZE_MAX = False # Not skipping can throw TooBig error
RESULT_STORAGE_EXPIRATION_SECONDS = 120
RESULT_STORAGE_STORES_UNSAFE = True
Using it is as simple as configuring it in your thumbor.conf file:
# thumbor.conf
STORAGE = 'thumbor_memcached.storage'
RESULT_STORAGE = 'thumbor_memcached.result_storage'
STORAGE
is used to cache the original incoming image, andRESULT_STORAGE
is used to cache the processed thumbor image.- By default Memcached has hard limit on
item_size_max
of 1024 * 1024 Bytes. This can be changed on startup. - The auto-discovery feature of AWS ElastiCache based Memcached is not part of the Memcached protocol standard, and hence it is not supported by the underlying
pylibmc
andlibmemcached
libraries.
This projects uses the following versioning scheme:
<thumbor major>.<memcached plugin major>.<memcached plugin minor>