[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discuss limits applied to storage.local API #351

Open
hanguokai opened this issue Feb 11, 2023 · 10 comments
Open

Discuss limits applied to storage.local API #351

hanguokai opened this issue Feb 11, 2023 · 10 comments
Labels
implemented: chrome Implemented in Chrome proposal Proposal for a change or new feature supportive: firefox Supportive from Firefox supportive: safari Supportive from Safari

Comments

@hanguokai
Copy link
Member
hanguokai commented Feb 11, 2023

(To avoid getting off topic #350, I open another discussion here)

storage.local and storage.sync are the oldest and most commonly used APIs. Usually they are used as persistent storage for user data or user settings.

Storage Quota

At present, storage.local has 5MB limit, storage.sync has 100KB limit. This limitation has existed for a long time. As user devices and cloud storage capabilities improve, should it be increased now?

I suggest increasing the storage limit of storage.sync to 1MB, and the storage limit of storage.local to 50MB.

I know the "unlimitedStorage" permission for storage.local. Due to the 5MB storage limit, I am often hesitant whether to use this permission, especially for user-defined data.

As a contrast, other Web storage technologies can use much more space by default, like CacheStorage and IndexedDB.

The browser's built-in support for data synchronization is great, because it's non-trivial for developers to create their own cloud synchronization. But due to the 100KB storage limit, to use it, I usually have to carefully evaluate each possible data item.

Performance

Does performance degrade as storage usage increases? Different browsers may have different implementations and optimizations. I didn't do the test. Normally, a Key-Value database should not have this problem.

@erosman
Copy link
erosman commented Feb 11, 2023

AFA storage.sync, in addition to Maximum total size, please also consider Maximum number of items and especially Maximum item size as well.

@xeenon xeenon added supportive: safari Supportive from Safari proposal Proposal for a change or new feature and removed needs-triage labels Feb 16, 2023
@xeenon
Copy link
Collaborator
xeenon commented Feb 16, 2023

I'm infer of bumping storage.local to 10 MB at least to match the bump of storage.session to 10 MB.

@Rob--W Rob--W added follow-up: chrome Needs a response from a Chrome representative supportive: firefox Supportive from Firefox labels Feb 16, 2023
@oliverdunk
Copy link
Member

Chrome is in support of raising the storage.local limit to 10 MB.

@oliverdunk oliverdunk added supportive: chrome Supportive from Chrome and removed follow-up: chrome Needs a response from a Chrome representative labels Mar 2, 2023
aarongable pushed a commit to chromium/chromium that referenced this issue Apr 19, 2023
Increase the memory limit of chrome.storage.local from 5MB
(5242880 bytes) to 10MB (10485760 bytes), following discussions in
the Web Extensions Community Group:
w3c/webextensions#351.

This makes sure we provide at least as much storage as storage.session.

Bug: 1434464
Change-Id: I373c54530a4183223d41142f91ba948c9f2a0c97
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4442269
Auto-Submit: Oliver Dunk <oliverdunk@chromium.org>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Commit-Queue: Devlin Cronin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1132267}
@oliverdunk
Copy link
Member

We've increased the storage.local limit to 10MB in Chrome, and it should be available in Canary later today, and in general from Chrome 114+ once that hits stable: https://bugs.chromium.org/p/chromium/issues/detail?id=1434464.

@fregante
Copy link

Great to see that storage.local has been bumped to 10MB. 🎊

Can storage.sync also be increased? 100KB is quite a small amount of data for 2024.

@oliverdunk
Copy link
Member

Can storage.sync also be increased? 100KB is quite a small amount of data for 2024.

This is the trickiest one to change since we would need to make sure the syncing mechanism in Chrome is able to handle it. Happy to discuss it but I suspect there would be some hesitation.

@hanguokai
Copy link
Member Author

Rob replied in another issue for storage.sync:

All vendors are against raising the maximum total size

If so, we can close this issue, although developers are looking forward to it very much.

@oliverdunk
Copy link
Member

@hanguokai, I think we should keep this open to track increasing the size of storage.local? Agree that there aren't any steps to take with storage.sync though.

@hanguokai
Copy link
Member Author

@oliverdunk Ok, we will close this issue when all browsers implement increasing the maximum total size of storage.local to 10MB. At the moment, only Chrome implements it. I didn't find related issues on Firefox and Safari's issue tracker.

@hanguokai hanguokai changed the title Discuss limits applied to storage.local and storage.sync API Discuss limits applied to storage.local API Jan 12, 2024
@hanguokai
Copy link
Member Author

I opened a new issue at #520 for storage.sync. I update this issue title and leave this issue only for storage.local, not for storage.sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implemented: chrome Implemented in Chrome proposal Proposal for a change or new feature supportive: firefox Supportive from Firefox supportive: safari Supportive from Safari
Projects
None yet
Development

No branches or pull requests

6 participants