title: In HTML5, can you save an image to cache programmatically?
body: <p>I love that in HTML5 you can save text data out to a local database, and can even use SQL to do it. (<a href="http://webkit.org/blog/126/webkit-does-html5-client-side-database-storage/" rel="noreferrer">http://webkit.org/blog/126/webkit-does-html5-client-side-database-storage/</a>)</p>
  
  <p>I've got an app that I've written for the iPhone's MObile Safari that caches everything offline except for images.  The images still have to be downloaded from the server, and I don't know how to ensure that they will stay cached.  Ideally, I'd like to write them out to the localStorage database.</p>
  
  <p>I was thinking of writing an image to the canvas, and then serializing that as text... any ideas?  Is there any easier way to do this?</p>
  
  <p>Ideally, I'd like to do this all with HTML and JavaScript, no native apps/objective-C.</p>