Skip to main content

Django cache backend using pylibmc

Project description

This package provides a memcached cache backend for Django using pylibmc. You want to use pylibmc because it’s fast.

Requirements

django-pylibmc requires Django 1.2. It was written and tested on Python 2.6.

Installation

Get it from pypi:

pip install django-pylibmc

or github:

pip install -e git://github.com/jbalogh/django-pylibmc.git#egg=django-pylibmc

Usage

Your cache backend should look something like this:

CACHE_BACKEND = 'django_pylibmc.memcached://localhost:11211?timeout=500'

If you want to use the memcached binary protocol, pass binary=1 in your CACHE_BACKEND:

CACHE_BACKEND = 'django_pylibmc.memcached://localhost:11211?timeout=500&binary=1'

If you want to control pylibmc behaviors, use the setting called PYLIBMC_BEHAVIORS:

PYLIBMC_BEHAVIORS = {'tcp_nodelay': True, 'ketama': True}

PYLIBMC_BEHAVIORS is an empty dict by default.

Caveats

This package breaks away from the current handling of timeout=0 in Django. Django converts 0 into the default timeout, while django-pylibmc leaves it as 0. memcached takes 0 to mean “infinite timeout.” You can still pass None to get the default timeout.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-pylibmc-0.2.1.tar.gz (4.2 kB view details)

Uploaded Source

File details

Details for the file django-pylibmc-0.2.1.tar.gz.

File metadata

File hashes

Hashes for django-pylibmc-0.2.1.tar.gz
Algorithm Hash digest
SHA256 8f6e05dea4000347da86543402b4c564395dfbd04b8a27019994b352e7e3b33a
MD5 f886f99866cafa11ab322171d589af9f
BLAKE2b-256 78bce56fe7da63c1ac7d525fa296b1ce369d3c1dd619ae2a21fc6a825b1566fa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page