Recently I ran into an issue when attempting to display a very large GIF image on an iPad 3. The image in question was a 940 x 12043 screenshot of an application screen. The image was to have several absolutely positioned HTML elements layerd on top to simulate the interactive elements of the application. The problem was that the image wouldn't display despite returning a 200 OK status code.

The cause of the problem was that that image could not be decoded into the memory limits of the device. It turns out there are resource limits I wasn't aware of on iOS devices with 256MB RAM and higher. It makes sense for these devices to put a limit on resources to help reduce the draw on the battery and to increase performance of web browsing.

The documentation states that for devices with 256MB RAM the maximum size for decoded GIF images is 3 megapixels and 5 megapixels for devices with more than 256MB RAM. So doing a little math I confirmed that indeed the decoded size of my GIF image was too large. So to remedy the problem I had to break up the image into three separate images and stack them vertically on top of one another.

The moral of story is to keep the device resources in mind when producing your web content. Some devices will impose limits to help keep the user's battery from draining too quickly and your page responding quickly.