views:

153

answers:

2

I am building a web application in jQuery/HTML5 which will run in Webkit-based browsers on touchscreen kiosks.

There are a large (thousands) number of images which the application uses, which I need cached to each browser.

At first I thought a HTML5 cache manifest would be the best option (with the thousands of image URLs listed), but now I wonder if there is a better way? I would consider extensions/plugins too...

Thanks in advance!

A: 

I like this plugin: http://alexrabarts.github.com/jquery-cacheimage/

Here's another alternative: http://technosophos.com/content/precaching-images-jquery-slightly-better-way

And if you wanted to do preloading: http://engineeredweb.com/blog/09/12/preloading-images-jquery-and-javascript

EDIT: If offline browsing is needed, application cache is the way to go with HTML cache manifest. Here are some resources:

http://softwareas.com/offline-apps-with-application-cache-quickstart-tips-and-deep-dive

http://www.bennadel.com/blog/1944-Experimenting-With-HTML5-s-Cache-Manifest-For-Offline-Web-Applications.htm

bryan.taylor
Thanks for your reply, but I need the images to be cached permanently in each browser, even after the browser restarts. There is likely to be thousands of images totalling hundreds of megabytes of data.I might have to store the images as base-64 strings in the browser's local storage.
Anarchitect
@Anarchitect:I think you're going to have to use application cache for HTML5. I don't think there is a faster/efficient way, especially since that method would be native.
bryan.taylor
A: 

Answer

Thousands of images, potentially hundreds of MB's
This would be out of localstorage's approx 5 MB Cap. You could do a ClientDatabase and request some massive amount of space.

Resources I've dug up

http://dev.w3.org/html5/webdatabase/
http://webkit.org/blog/126/webkit-does-html5-client-side-database-storage/
http://creativepark.net/blog/entry/id/1191
http://ajaxian.com/archives/view-source-tutorial-sticky-notes-with-html5-and-css3

Rixius
Thanks for this, I am doing some experiments with Web DB now. Documentation has been a bit patchy though, so any pointers would be appreciated!
Anarchitect