'Custom File Upload on Aura Component - Upload Delay

I created a custom upload button for an Aura Component following the instructions in this post: Custom File Upload for Aura Component

I made an adjustment to upload to Content Version instead of Attachment but otherwise my development is identical. The code is working as expected and uploading the file in the correct format. The issue I am running into is a time delay. When the request is sent to upload the file the apex code does not receive the request until about 3 minutes later. I ran the debugger to see if there is a delay being caused by the code itself but on the Apex Side the Apex Class runs for about half a second. The aura component code runs for a similar amount of time.

Is there a specific reason a request would take so long to go from an Aura Component to an Apex Class? The reason for a custom file upload is that I am downgrading the quality of the images being uploaded before sending them to the Apex Class. This downgrade code runs for less than half a second as well. The delay I see is from when the request is sent till Apex Receives the request. Every once in a while the request is received almost instantly but I haven't found a reason for this. I can upload the same file and get vastly different time results.

Any help would be greatly appreciated!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source