Opened 10 years ago
Last modified 4 years ago
#25748 new defect (bug)
Delay when sending many images to the editor
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.7 |
Component: | Media | Keywords: | needs-patch |
Focuses: | performance | Cc: |
Description
Clicking the "insert into post" button after uploading many images can result in a really long delay before the image markup is added to the editor. Here is an example on my local installation:
http://screencast.com/t/ja8cqXyHSw
So you can imagine that the same issue on a remote server could result in a painfully long delay (I've seen it take 30+ seconds).
It looks like the cause of the delay is in the individual post request that happens for each image when sending them to the editor. What is the purpose of these requests? Isn't all the data needed to send the image markup to the editor available to the javascript when the button is clicked?
If not, and those requests have to happen in their current form, there should be some sort of "loading..." indicator on the editor screen letting the user know something is happening, because currently the assumption would be that the insertion failed.
And regarding the likelihood of someone inserting that number of images into a single post, photographers will regularly upload 30, 40, 50 or more images to a post after a shoot.
You're right, an ajax call is made for every attachment that is being "sent" to the editor. This is to build the html markup for the attachment, which gets filtered applied (
image_send_to_editor
,media_send_to_editor
).We could make a batch resource and make one request rather than multiple requests.