Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

django-beefycachecontrol

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-beefycachecontrol

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

  • 0.2.1
  • PyPI
  • Socket score

Maintainers
1

django-beefycachecontrol

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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc