https-everywhere icon indicating copy to clipboard operation
https-everywhere copied to clipboard

Use IndexedDB instead of WebStorage

Open KOLANICH opened this issue 7 years ago • 3 comments

Type: code issue

WebStorage uses text files with serialized JSON. It has multiple issues.

  1. The file is completely rewritten on any modification. This causes flash burning out on devices using flash memory-based SSD.
  2. json escapes special characters, which is inefficient.
  3. You have to serialize binary data into base64 which is damn inefficient.

The better approach is to use IndexedDB which allows storage of binary data and also has DB capabilities, which can be used for incremental updates.

I guess some compression support is also needed, maybe some modification to FF allowing to use compressed SQLite files.

KOLANICH avatar Sep 18 '18 07:09 KOLANICH

From what I understand, this change will be automatic with FF 56. Is that correct?

https://blog.mozilla.org/addons/2019/02/15/extensions-in-firefox-66/

Bisaloo avatar Feb 16 '19 15:02 Bisaloo

I don't think so. DB is more than just a key-value storage. Though it may solve some issues, to make the stuff work better, one should make use of DB features like transactions.

KOLANICH avatar Feb 16 '19 17:02 KOLANICH

From what I understand, this change will be automatic with FF 56. Is that correct?

https://blog.mozilla.org/addons/2019/02/15/extensions-in-firefox-66/

My understanding is that the change should be automatic from FF 66, but storage waste with JSON escape and base64 encoding will remain to be solve on the extension side.

cschanaj avatar Mar 30 '19 02:03 cschanaj