[Django] #30722: Rate-limit autocomplete widgets Ajax requests

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

[Django] #30722: Rate-limit autocomplete widgets Ajax requests

Django
#30722: Rate-limit autocomplete widgets Ajax requests
-------------------------------------+-------------------------------------
               Reporter:  Federico   |          Owner:  nobody
  Jaramillo Martínez                 |
                   Type:             |         Status:  new
  Uncategorized                      |
              Component:             |        Version:  master
  contrib.admin                      |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 The current implementation of the Ajax autocomplete widget using Select2
 in Django triggers a request for every key-press. This creates unnecessary
 load on servers.

 This patch rate-limit the requests by adding a delay using the
 `ajax.delay` option provided by Select2.

--
Ticket URL: <https://code.djangoproject.com/ticket/30722>
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/053.315dcc6dc7dd4e7812743b5d6e633eb0%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30722: Rate-limit autocomplete widgets Ajax requests

Django
#30722: Rate-limit autocomplete widgets Ajax requests
-------------------------------------+-------------------------------------
     Reporter:  Federico Jaramillo   |                    Owner:  nobody
  Martínez                           |
         Type:  Uncategorized        |                   Status:  new
    Component:  contrib.admin        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Federico Jaramillo Martínez):

 * Attachment "no-rate-limit.mp4" added.

 Multiple consecutive request

--
Ticket URL: <https://code.djangoproject.com/ticket/30722>
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.bf877aca56e2bbfe7bc0b38d62387e2e%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30722: Rate-limit autocomplete widgets Ajax requests

Django
In reply to this post by Django
#30722: Rate-limit autocomplete widgets Ajax requests
-------------------------------------+-------------------------------------
     Reporter:  Federico Jaramillo   |                    Owner:  nobody
  Martínez                           |
         Type:  Uncategorized        |                   Status:  new
    Component:  contrib.admin        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Federico Jaramillo Martínez):

 * Attachment "with-rate-limit.mp4" added.

 Requests with a delay until user stops typing

--
Ticket URL: <https://code.djangoproject.com/ticket/30722>
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.5a3c7ab93b29c8980a57dcc7af01974e%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30722: Rate-limit autocomplete widgets Ajax requests

Django
In reply to this post by Django
#30722: Rate-limit autocomplete widgets Ajax requests
-------------------------------------+-------------------------------------
     Reporter:  Federico Jaramillo   |                    Owner:  nobody
  Martínez                           |
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  contrib.admin        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Federico Jaramillo Martínez):

 * has_patch:  0 => 1
 * type:  Uncategorized => Cleanup/optimization


Old description:

> The current implementation of the Ajax autocomplete widget using Select2
> in Django triggers a request for every key-press. This creates
> unnecessary load on servers.
>
> This patch rate-limit the requests by adding a delay using the
> `ajax.delay` option provided by Select2.

New description:

 The current implementation of the Ajax autocomplete widget using Select2
 in Django triggers a request for every key-press. This creates unnecessary
 load on servers.

 This patch rate-limit the requests by adding a delay using the
 `ajax.delay` option provided by Select2.

 https://github.com/django/django/pull/11695

--

Comment:

 Include link to PR

--
Ticket URL: <https://code.djangoproject.com/ticket/30722#comment:1>
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.7055c9ae9fed82761d1c7c2ca0110312%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30722: Rate-limit autocomplete widgets Ajax requests

Django
In reply to this post by Django
#30722: Rate-limit autocomplete widgets Ajax requests
-------------------------------------+-------------------------------------
     Reporter:  Federico Jaramillo   |                    Owner:  nobody
  Martínez                           |
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  contrib.admin        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

 * stage:  Unreviewed => Accepted


Comment:

 I cannot say for sure 500 is the good value, but some delay is definitely
 an improvement.

--
Ticket URL: <https://code.djangoproject.com/ticket/30722#comment:2>
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.df57010afdbe94a46021c4e87c15e1e1%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30722: Rate-limit autocomplete widgets Ajax requests

Django
In reply to this post by Django
#30722: Rate-limit autocomplete widgets Ajax requests
-------------------------------------+-------------------------------------
     Reporter:  Federico Jaramillo   |                    Owner:  Federico
  Martínez                           |  Jaramillo Martínez
         Type:                       |                   Status:  assigned
  Cleanup/optimization               |
    Component:  contrib.admin        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by felixxm):

 * status:  new => assigned
 * needs_better_patch:  0 => 1
 * owner:  nobody => Federico Jaramillo Martínez


--
Ticket URL: <https://code.djangoproject.com/ticket/30722#comment:3>
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.716f14f0434e7f128d43a049abb79aa7%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30722: Rate-limit autocomplete widgets Ajax requests

Django
In reply to this post by Django
#30722: Rate-limit autocomplete widgets Ajax requests
-------------------------------------+-------------------------------------
     Reporter:  Federico Jaramillo   |                    Owner:  Federico
  Martínez                           |  Jaramillo Martínez
         Type:                       |                   Status:  assigned
  Cleanup/optimization               |
    Component:  contrib.admin        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Federico Jaramillo Martínez):

 * needs_better_patch:  1 => 0


Comment:

 Updated the patch, tests are passing.

 500 was the number that gave me the least amount of unnecessary requests
 while still giving a perception of responsiveness, but those were more or
 less empiric tests with some co-workers. More than 500 **felt** slow.

 We found that less than 250 would start sending requests for slow typers.

 Given that this would be a default, I proposed 500 as that was the higher
 acceptable number for us. If a specific site requires a lower delay, it
 can be overridden on a custom widget or by overriding
 `resources/static/admin/js/autocomplete.js`.

 I thought that it would be more important to avoid unnecessary requests
 over the gain of 100ms in the admin area.

--
Ticket URL: <https://code.djangoproject.com/ticket/30722#comment:4>
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.be6d2eeb774e5a4bd0e95fd8f61957a7%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30722: Rate-limit autocomplete widgets Ajax requests

Django
In reply to this post by Django
#30722: Rate-limit autocomplete widgets Ajax requests
-------------------------------------+-------------------------------------
     Reporter:  Federico Jaramillo   |                    Owner:  Federico
  Martínez                           |  Jaramillo Martínez
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  contrib.admin        |                  Version:  master
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"8f6860863e34cb1cbe24161f1c4e7c79007e93dc" 8f686086]:
 {{{
 #!CommitTicketReference repository=""
 revision="8f6860863e34cb1cbe24161f1c4e7c79007e93dc"
 Fixed #30722 -- Added default rate-limiting requests to admin's Select2
 widget.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30722#comment:5>
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.7960bb87012607e541a0f125d1715eea%40djangoproject.com.