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
easy_install django-beefycachecontrol or pip install django-beefycachecontrol
Add beefycachecontrol to your INSTALLED_APPS
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.
Metadata
Release files for django-beefycachecontrol 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django-beefycachecontrol-0.2.1.tar.gz | 2.9 kB | Without provenance | Details |
Release files / django-beefycachecontrol-0.2.1.tar.gz
| Download URL | django-beefycachecontrol-0.2.1.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b82750cdf9b667e96c641530deccc4769e5d42a6fa064e06d17385e370b57d4d
|
|
BLAKE2b-256 checksum How to use checksums |
c3af668c5388a07c427b3339a021000f8b8a25e9d454bda188856a135f5b6ed0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-beefycachecontrol 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.