[wp-trac] [WordPress Trac] #38911: Prevent Media Library search making an AJAX request for each char typed.

WordPress Trac noreply at wordpress.org
Wed Nov 23 08:29:21 UTC 2016


#38911: Prevent Media Library search making an AJAX request for each char typed.
-------------------------------------------------+-------------------------
 Reporter:  brandomeniconi                       |      Owner:
     Type:  enhancement                          |     Status:  new
 Priority:  normal                               |  Milestone:  Awaiting
Component:  Media                                |  Review
 Severity:  normal                               |    Version:  4.6.1
  Focuses:  javascript, administration,          |   Keywords:
  performance                                    |
-------------------------------------------------+-------------------------
 I've noticed that while searching for a media in the "Media Library", WP
 makes an AJAX request immediately after a char is typed. So if I type in a
 long word, it will do a lot of sequential AJAX requests to the server.

 In most small site environments that is fine, but in some large WP
 installations with a lot of media (and traffic), sometimes each request
 takes few seconds to complete, causing the latest requests failing due to
 queue timeout and the Library interface to hang.

 I will be great if, while the user is typing, the UI only makes an AJAX
 request if the user has stopped writing for a determined amount of time.
 I've noticed that there is already a _.debounce handler in media-grid.js
 but it doesn't cancel the intermediate requests.

 I've inspected this in few sites (with WP 4.6.1 ad very few plugins) and
 all have this behavior.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38911>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list