开发者

Store Image in HTML 5 Web SQL Database

开发者 https://www.devze.com 2023-03-27 01:05 出处:网络
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%.

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:

  1. HTTP cache. Set long expiry headers, Cache-control: public. If you don't need long-term off-line capability, it will "just work".

  2. HTML5 offline "web application" feature (add image to manifest file). This way image will be stored by the browser without extra overhead.

  3. localStorage. WebSQL spec is deprecated and its replacement, IndexedDB, isn't widely supported yet. Local Storage is also faster than WebSQL.

0

精彩评论

暂无评论...
验证码 换一张
取 消