This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Beefier Cache-Control HTTP headers created by @never_cache decorator in Django.

Project Description

django-beefycachecontrol is a Django middleware that smacks misbehaving upstream caches into submission with beefier anti-cache HTTP headers.

Normally, when a view is decorated with @never_cache:

@never_cache
def my_view(request):
    ...

The resulting HTTP headers (among other things) include:

Cache-Control       max-age=0

While this should be sufficient to prevent the response from being cached upstream, but there may be circumstances where this is not enough. Enter django-beefiercachecontrol!

With BeefyCacheControlMiddleware enabled, these HTTP headers become:

Cache-Control       max-age=0, no-cache, no-store

Cache that and you’d be arrested by the internet cops!

Installation

  1. easy_install django-beefycachecontrol or pip install django-beefycachecontrol
  2. Add beefycachecontrol to your INSTALLED_APPS
  3. In settings.py add 'beefycachecontrol.middleware.BeefyCacheControlMiddleware' to MIDDLEWARE_CLASSES

Usage

django-beefycachecontrol is a middleware. Once it is enabled, there is nothing more to do. It simply fixes up your no-cache related HTTP headers.

Release History

Release History

This version
History Node

0.2.1

History Node

0.2

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-beefycachecontrol-0.2.1.tar.gz (2.9 kB) Copy SHA256 Checksum SHA256 Source Aug 20, 2011

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting