#24720: using middleware.common to append slashes causes extra overhead to all
requests that do not end in a slash
-------------------------------------+-------------------------------------
     Reporter:  electricjay          |      Owner:  nobody
         Type:                       |     Status:  new
  Cleanup/optimization               |
    Component:  Core (Other)         |    Version:  master
     Severity:  Normal               |   Keywords:  optimization middleware
                                     |  common
 Triage Stage:  Unreviewed           |  Has patch:  1
Easy pickings:  0                    |      UI/UX:  0
-------------------------------------+-------------------------------------
 Checking if a url is valid is just as costly as fully resolving the url,
 so when the common middleware checks if it should append a slash it is
 fully doubling the url resolution overhead (which is about 5%) (this
 overhead only applies to urls that do not already end in a slash)

 By deferring the checks until the ''process_response'' phase we can make
 sure that we only pay the price for urls that actually need a slash
 appended (that is to say would actually return a 404).

 Pull request:
 https://github.com/django/django/pull/4574

--
Ticket URL: <https://code.djangoproject.com/ticket/24720>
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/054.e2105a494a20b675083fdf8c3777072d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to