This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
# django-smartcc
Set some cache-related headers automatically, defining not-authenticated
requests as public and authenticated requests as private. You can also customize these values for specific URLs. This middleware class will also setup these HTTP headers:

* Vary
* Cache-Control
* Expires

This middleware works and is designed to integrate Django with CloudFlare Cache (or similar services). Used in production on servers.

## Installation
Add django-smartcc on your requirements.txt file or just launch:

pip install -U django-smartcc

Then add django-smartcc in the installed apps and in the middleware, so add these line in your file.



**Note**: Remember that this middleware requires authentication, so it should be loaded after the *django.contrib.auth.middleware.AuthenticationMiddleware*!

## Customization and Settings
You can customize a specific Cache-control value on each URL. For example
if we want to avoid cache on */hello/* , but always have it on */api/search* for 5 minutes, we should write this in our settings file:

(r'/hello/$', 'private', 0),
(r'/api/search$', 'public', 300),

Other options are available to customize the behaviour of the middleware:

**SCC_SET_VARY_HEADER**: Define if the middleware have to set the Vary header.
Default value: *True*

**SCC_SET_EXPIRE_HEADER**: Define if the middleware should set the Expires
header. Default value: *True*

**SCC_MAX_AGE_PUBLIC**: Define the default max-age value in seconds for public
requests. Default value: *86400*

**SCC_MAX_AGE_PRIVATE**: Define the default max-age value in seconds for
private requests. Default value: *0*
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-smartcc-0.1.2.tar.gz (2.6 kB) Copy SHA256 Checksum SHA256 Source Feb 11, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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