#24696: CSRF middleware wastefully calculates new tokens that are never used .
--------------------------------------+------------------------------
     Reporter:  electricjay           |      Owner:  nobody
         Type:  Cleanup/optimization  |     Status:  new
    Component:  CSRF                  |    Version:  1.8
     Severity:  Normal                |   Keywords:  CSRF performance
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+------------------------------
 When a client requests a page from a site running the csrf middleware and
 does not send a csrf cookie - a new CSRF token is generated even if the
 page does not use the token.  This unnecessary token generation can add
 about 40% to the response time for simple requests.

 I have created a pull request with a solution that only generates a csrf
 token when it is going to be used.

 Git hub pull request:
 https://github.com/django/django/pull/4550

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

Reply via email to