#36560: When the Cache-Control header is set to no-store, the response is 
cached.
-------------------------------------+-------------------------------------
     Reporter:  mengxunQAQ           |                    Owner:  (none)
         Type:  Bug                  |                   Status:  new
    Component:  Core (Cache system)  |                  Version:  5.2
     Severity:  Normal               |               Resolution:
     Keywords:  cache                |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by mengxunQAQ:

Old description:

> {{{
> from django.http import HttpResponse
> import datetime
>
> def cache_demo(request):
>     resp = HttpResponse(f"Current content at {datetime.datetime.now()}")
>     resp["Cache-Control"] = "no-store"
>     return resp
>
> }}}
> Based on the example above, when the Cache-Control header is set to no-
> store, the response content is still cached.

New description:

 **settings.py**
 {{{
 ...
 MIDDLEWARE = [
     "django.middleware.cache.UpdateCacheMiddleware",
     "django.middleware.common.CommonMiddleware",
     "django.middleware.cache.FetchFromCacheMiddleware",
 ]
 ...
 }}}

 **views.py**
 {{{
 from django.http import HttpResponse
 import datetime

 def cache_demo(request):
     resp = HttpResponse(f"Current content at {datetime.datetime.now()}")
     resp["Cache-Control"] = "no-store"
     return resp

 }}}

 Based on the example above, when the Cache-Control header is set to no-
 store, the response content is still cached.

--
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36560#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070198c19daf31-392c98e3-cff9-4e10-851b-12c5e1f3be56-000000%40eu-central-1.amazonses.com.

Reply via email to