#29925: Redirect with HTTP/2 Server Push
-------------------------------------+-------------------------------------
               Reporter:  Jaap Roes  |          Owner:  nobody
                   Type:  New        |         Status:  new
  feature                            |
              Component:  HTTP       |        Version:  master
  handling                           |       Keywords:  http2 server push
               Severity:  Normal     |  redirects
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I was looking into upgrading nginx and reading it's changelog when I
 noticed [https://www.nginx.com/blog/nginx-1-13-9-http2-server-push/ HTTP/2
 Server Push support was introduced semi-recently].

 This reminded me of [https://twitter.com/simonw/status/1047865898717966337
 this Tweet by Simon Willison] about accelerating redirects using a HTTP/2
 Server Push header. I did some further research and stumbled upon
 [https://www.ctrl.blog/entry/http2-push-redirects  this article] about the
 same concept.

 This got me thinking about using this technique in Django.

 There are a few places in Django's code base that will perform redirects
 to "better" urls, e.g. when using `CommonMiddleware` and `APPEND_SLASH is
 True` and/or `PREPEND_WWW is True` or using `LocaleMiddleware` i.c.w.
 `i18n_patterns`. Wouldn't it be nice if these redirects also included a
 `Link: <redirect-location>; rel=preload` header?

 Would adding something like this be acceptable to the Django codebase? I'm
 unsure if it's safe to include this header on non-http/2
 connections/servers, but I'd assume it will be.

 A step further would be to always do this for all
 `HttpResponseRedirectBase` classes, or alternatively, introduce a
 `Http2ServerPushRedirectBase` class.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29925>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.b99859bc33328cfbab6ca6dbccaf40c2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to