Scattered 400 error when loading large image sequence

Hi,
Absolute newcomer here. I’m currently attempting to use the free version of netlify to serve a collection of image sequences. The images are used as animation frames for a psychology experiment hosted on pavlovia.org. They are small (1kb-70kb) black and white gifs, but there are 17393 of them for a total of 534mb.

The images look great when I access them on my netlify url, but when I load them into my experiment I get 400 errors for random (different each time) images which prevents my experiment from loading. I do not encounter this problem when I load the images from their github repo.

example of the 400 error:

Here’s a link to one of the images in the error for reference. Each image loads fine on its own, but when I load them en mass to my pavlovia experiment I get scattered 400 errors (as shown above):
https://festive-hypatia-be06ed.netlify.app/img/999/b25/999_b25(698).gif

I’d imagine that I’m going about everything wrong, and happy to hear your suggestions. But I’m excited at the speed with which the images load before I get a failure, so I’m hoping I can stick with netlify.

Thanks for the help.
-Nate

Hi @nghess ,

I have not received such an error.

Hi @coelmay,
Yep, I don’t receive an error either when I go to the images one at a time, just when I try to load them into my experiment. I’m guessing that I’m sending too many requests too quickly to the netlify site. Any ideas?
Thanks!

Sending too many requests would usually result in a 429 status code. A 400 is a bad request which means The request could not be understood by the server due to malformed syntax.

I missed this before:

That’s likely the reason. Way too much data for a single webpage (or even whole site!)

Oh man. It was actually a dumb mistake on the other end that for whatever reason didn’t result in a 400 when I got the images from github: I was requesting some of the same image arrays twice in my preloader.

It works perfectly now. And I gotta say I’m impressed at the performance. 17393 files is indeed way too much :slight_smile: But it had to be done to preserve the animation quality, and netlify pulled it off nicely.

1 Like

Instead of loading copious amounts of images for an animation, have you considered using CSS or Javascript for animation? Would result in a smaller payload and possibly higher quality render.

Here’s a demo I found:

https://keithclark.co.uk/labs/css-fps/

That demo is super cool.

Unfortunately I have to use this method. Generating the patterns in realtime isn’t feasible, and i need compression-free images.

However, all is well and netlify appears to be working great.

Thanks for your suggestions!

1 Like