Prevent Media Library search making an AJAX request for each char typed.
|Reported by:||brandomeniconi||Owned by:||adamsilverstein|
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.
Change History (25)
- Keywords has-patch 2nd-opinion added
- Owner set to adamsilverstein
- Status changed from new to assigned