Skip to main content

django-postleware

A simple django middleware class which injects a Cache-Control: no-cache header onto POST responses.

Installing

  1. pip install django-postleware

  2. Add the middleware to settings.py

MIDDLEWARE_CLASSES = (
    'postleware.PostResponseCachebusterMiddleware',
    # ...
)

Why?

Mobile Webkit (iOS4+ and Android stock bowser) has a bug that causes it to cache similar POST requests when it clearly shouldn’t. Rather than only caching requests that have a specific Cache-Control header, it does the opposite and caches the request unless the no-cache value is present in the POST response.

Not working for you?

Let me know by opening an issue or pull request. This was enough for me, but I have read around the webs that other devs needed to add additional headers to the response before it would stop caching.

Metadata

Release files for django-postleware 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-postleware 1.0.1
File Size Uploaded Provenance Actions
django-postleware-1.0.1.tar.gz 6.1 kB Without provenance Details for django-postleware-1.0.1.tar.gz

Release files / django-postleware-1.0.1.tar.gz

Download URL django-postleware-1.0.1.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
146ed96753930132e1087f5d94b50e82c3d6a85387cd609bd015655711cb1a8b
BLAKE2b-256 checksum
How to use checksums
f42a7d698ef126e5d8cea973c45c4e2eb95752a990befa940d11bcbfb2774324
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-postleware 1.0.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.

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page