Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
django-beefycachecontrol
Advanced tools
Beefier Cache-Control HTTP headers created by @never_cache decorator in Django.
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.
FAQs
Beefier Cache-Control HTTP headers created by @never_cache decorator in Django.
We found that django-beefycachecontrol demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.