There are only two other options that I can imagine, given your situation:
- Use the "data:" protocol and echo the base64 version of your thumbnails directly into the HTML page. I would not recommend this, since you cannot cache these images in the users browser.
- Use HTML5 Web Storage to store all images as records with base64 encoded data stored as a BLOB in a column. Once the database has loaded onto the user's computer, use Javascript to view all the entries and create thumbnails on the page using jQuery. With this option, you will need to wait until the entire database is loaded in the end-userβs browser and they need a fairly modern browser.
I think your best bet is a combination of lazy loading, expiration header caching, and serving images from multiple host names.
If images can be grouped logically, CSS sprites can also work for you in addition to the above. For example, if your thumbnails are for images uploaded on a specific day ... you can create one file for each day, which can then be cached in the users browser.
John kramlich
source share