Skip to main content

A simple django middleware that ensures POSTs aren't cached by clients.

Project description

# django-postleware

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

# 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-postleware-1.0.tar.gz (1.0 kB view details)

Uploaded Source

File details

Details for the file django-postleware-1.0.tar.gz.

File metadata

File hashes

Hashes for django-postleware-1.0.tar.gz
Algorithm Hash digest
SHA256 533ed73d636b5ec8346916d2501b95401b96fb24ab9b8dd2435e6b38aa98cd2a
MD5 d81c931db92d07895edfefd79b53aa17
BLAKE2b-256 6658a358c9e33e34b3599e22633a2523af33c493f0e8ffa500e2da146acadacd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page