How can store offline Image in HTML 5 Web SQL Dat开发者_如何学Cabase?
Yes, but you'll have to store it as data:
URL with base64 encoding which increases file size by 33%.
However, first try using, in that order:
HTTP cache. Set long expiry headers,
Cache-control: public
. If you don't need long-term off-line capability, it will "just work".HTML5 offline "web application" feature (add image to manifest file). This way image will be stored by the browser without extra overhead.
localStorage
. WebSQL spec is deprecated and its replacement, IndexedDB, isn't widely supported yet. Local Storage is also faster than WebSQL.
精彩评论