Make WordPress Core

Opened 10 years ago

Last modified 5 years ago

#25748 new defect (bug)

Delay when sending many images to the editor

Reported by: matthewdietsche's profile matthewdietsche 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.

Change History (5)

#1 @SergeyBiryukov
10 years ago

  • Component changed from Upload to Media

#2 @toscho
10 years ago

  • Cc info@… added

#3 @ericlewis
10 years ago

  • Focuses performance added
  • Keywords needs-patch added

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.

#4 @ericlewis
10 years ago

  • Summary changed from Long (confusing) delay when sending many images to editor with "insert into post" button to Delay when sending many images to the editor

#5 @helen
9 years ago

  • Milestone changed from Awaiting Review to Future Release

Would like to see a patch here.

Note: See TracTickets for help on using tickets.