Cache-control decorator and s-maxage

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Cache-control decorator and s-maxage

Tomasz Knapik
Hi everyone,

I've been wondering what you think about making the cache-control
decorator do the same thing to s-maxage as it does to maxage, i.e. when
overriding the maxage value it chooses the lower value [1]. I can't see
why not since they're both included in the spec [2], but would want to
check whether there's an issue in just filing a ticket/patch.

s-maxage is quite useful when you want to set a different expiration
for the shared and browser's cache. I would have assumed it's commonly
used in web development so it'd make sense to have it in a web
framework, especially if maxage is supported.

Tomasz

[1]: https://github.com/django/django/blob/02cd16a7a04529c726e5bb5a13d5
979119f25c7d/django/utils/cache.py#L68-L72
[2]: https://tools.ietf.org/html/rfc7234#section-5.2.2.9

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/484f8c0fb35a33d939b072e04e81fd7b8992b437.camel%40tmkn.org.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Cache-control decorator and s-maxage

Adam Johnson-2
Seems like a fairly straightforward, inoffensive change to me! Make a ticket and let me know, I'll help review

On Fri, 22 Jun 2018 at 18:58, Tomasz Knapik <[hidden email]> wrote:
Hi everyone,

I've been wondering what you think about making the cache-control
decorator do the same thing to s-maxage as it does to maxage, i.e. when
overriding the maxage value it chooses the lower value [1]. I can't see
why not since they're both included in the spec [2], but would want to
check whether there's an issue in just filing a ticket/patch.

s-maxage is quite useful when you want to set a different expiration
for the shared and browser's cache. I would have assumed it's commonly
used in web development so it'd make sense to have it in a web
framework, especially if maxage is supported.

Tomasz

[1]: https://github.com/django/django/blob/02cd16a7a04529c726e5bb5a13d5
979119f25c7d/django/utils/cache.py#L68-L72

[2]: https://tools.ietf.org/html/rfc7234#section-5.2.2.9

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/484f8c0fb35a33d939b072e04e81fd7b8992b437.camel%40tmkn.org.
For more options, visit https://groups.google.com/d/optout.


--
Adam

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMyDDM3NXVnkRFONF%3DaJCXzaCEkWHoqO-FA24o%2BDQAJQGvaG%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.