The comments in `UpdateCacheMiddleware.process_response()` indicate it's
trying to set the timeout by first looking for the `max-age` header before
reverting to the **default** cache_timeout :
**Try to get the timeout from the "max-age" section of the "Cache-
Control" header before reverting to using the default cache_timeout
length.**
However, `cache_page(timeout=3600*24)` is explicitly setting the
`cache_timeout` so that is what should be used.
In summary, if a user wants the client-side cache to be shorter-lived than
the server-side cache, it is currently not possible using these two
decorators.
--
Ticket URL: <https://code.djangoproject.com/ticket/30765>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
Comment:
OK, yes, this seems legitimate.
Current behaviour was deliberately introduced in #5813
(f2f6e70b08b1142055e33e75f58cfe7fbb5d868f).
(Looking at
[https://code.djangoproject.com/query?status=!closed&component=Core+(Cache+system)
tickets for Core+(Cache+system)] there are a few on similar, though not
exactly, topics.)
--
Ticket URL: <https://code.djangoproject.com/ticket/30765#comment:1>
Comment (by Danny Flack):
I have an idea of how to solve this but I assume the core developers have
a better understanding of why it was done this way in the first place, and
what else it'll affect. Is it worth me submitting a patch? Please let me
know how I can help.
--
Ticket URL: <https://code.djangoproject.com/ticket/30765#comment:2>
Comment (by Carlton Gibson):
Hi Danny.
Perhaps a post to the DevelopersMailingList, explaining as clearly as
possible what's going on, and your idea, would be the best way to go.
That way, you're likely to get the feedback you need.
Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/30765#comment:3>
Comment (by Danny Flack):
Thanks. I posted a new topic on that list.
https://groups.google.com/forum/#!topic/django-developers/BwTZFMpqd6U
--
Ticket URL: <https://code.djangoproject.com/ticket/30765#comment:4>
* owner: nobody => Flavio Curella
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/30765#comment:5>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/11823 PR on github]
--
Ticket URL: <https://code.djangoproject.com/ticket/30765#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"d08d4f464ab11cc226d4e197c0f43e26a7fd2961" d08d4f4]:
{{{
#!CommitTicketReference repository=""
revision="d08d4f464ab11cc226d4e197c0f43e26a7fd2961"
Fixed #30765 -- Made cache_page decorator take precedence over max-age
Cache-Control directive.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30765#comment:7>