We use large background images (hi-res photos, up to 700 KB) for our page design. It's part of the experience of the site that as you browse around, you see different images.
At the moment a different (random) image is loaded on each page request, from a pool of ~15 images, which could grow over time.
I'm looking for a sane way to optimize this:
- To avoid the user having to download a big image file on every page view
- To reduce load on the server (is this an issue, will the server keep the images in memory?)
The ideas I have so far include:
- A timer which loads a different image at set intervals
- Progressively loading other images in the background with ajax
- Associating images with specific content (pages, tags)
The question is, how to keep it feeling somewhat random, while minimizing page load times and server hit?