Square.js loading with progress bar

I noticed that the sandbox square.js file required to load square functions is largeish (about 380KB uncompressed or 110KB compressed). I imagine the production square.js has a similar file size.

I have figured out in javascript how to display the progress of a file download using XMLHttpRequest, however it requires the server to pass the HTTP content-length header to the client for the client to see progress.

Would someone be able to update the square server so that when one requests square.js, the content-length header is displayed as part of the HTTP headers?

I ask this because if my customers are stuck under a bridge with a weak connection trying to make a purchase, they will get frustrated for waiting too long for the square script to load.

At this time the Content-Length header in the HTTP response when serving the square.js file isn’t currently available when the Web Payments SDK loads. We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team. :slightly_smiling_face: