content icon indicating copy to clipboard operation
content copied to clipboard

Clarify localStorage maximum

Open smith558 opened this issue 1 year ago • 2 comments
trafficstars

Updated according to https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria#web_storage

smith558 avatar Feb 11 '24 17:02 smith558

Preview URLs

(comment last updated: 2024-04-10 00:26:46)

github-actions[bot] avatar Feb 11 '24 17:02 github-actions[bot]

Thanks for your PR, @smith558 ! These days the definitive place where we talk about storage limits is https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria. So I think it would be better not to talk about storage limits in https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API, and instead link to https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria.

So what I think we should do here is: delete both bullets that start with "Storage limit is...", and after the following paragraph (the one beginning "These mechanisms are..." have a new paragraph, something like:

To learn about the amount of storage available using the APIs, and what happens when stprage limits are exceeded, see Storage quotas and eviction criteria.

wbamberg avatar Feb 13 '24 19:02 wbamberg

Hi @smith558 - there are some reviewer comments outstanding for you to take a look at. Do you plan to come back to this one? Thank you :)

bsmth avatar Mar 20 '24 09:03 bsmth

Hi @smith558 - there are some reviewer comments outstanding for you to take a look at. Do you plan to come back to this one? Thank you :)

Hi. Thanks for the reminder. Will have a look at this within the next few days.

smith558 avatar Mar 20 '24 10:03 smith558

Hi @smith558 - are you okay with maintainers making the suggested changes to your branch? Will has suggested something like this (deletions in red and additions in green):

 - `localStorage` does the same thing, but persists even when the browser is closed and reopened.
-
-  - Stores data with no expiration date, and gets cleared only through JavaScript, or clearing the Browser cache / Locally Stored Data.
-  - Storage limit is usually also at most 5MB (may vary between browsers).

These mechanisms are available via the {{domxref("Window.sessionStorage")}} and {{domxref("Window.localStorage")}} properties (to be more precise, the `Window` object implements the `WindowLocalStorage` and `WindowSessionStorage` objects, which the `localStorage` and `sessionStorage` properties hang off) — invoking one of these will create an instance of the {{domxref("Storage")}} object, through which data items can be set, retrieved and removed. A different Storage object is used for the `sessionStorage` and `localStorage` for each origin — they function and are controlled separately.
+To learn about the amount of storage available using the APIs, and what happens when storage limits are exceeded, see [Storage quotas and eviction criteria](/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria).

bsmth avatar Apr 09 '24 15:04 bsmth

Hi @smith558 - are you okay with maintainers making the suggested changes to your branch? Will has suggested something like this (deletions in red and additions in green):

 - `localStorage` does the same thing, but persists even when the browser is closed and reopened.
-
-  - Stores data with no expiration date, and gets cleared only through JavaScript, or clearing the Browser cache / Locally Stored Data.
-  - Storage limit is usually also at most 5MB (may vary between browsers).

These mechanisms are available via the {{domxref("Window.sessionStorage")}} and {{domxref("Window.localStorage")}} properties (to be more precise, the `Window` object implements the `WindowLocalStorage` and `WindowSessionStorage` objects, which the `localStorage` and `sessionStorage` properties hang off) — invoking one of these will create an instance of the {{domxref("Storage")}} object, through which data items can be set, retrieved and removed. A different Storage object is used for the `sessionStorage` and `localStorage` for each origin — they function and are controlled separately.
+To learn about the amount of storage available using the APIs, and what happens when storage limits are exceeded, see [Storage quotas and eviction criteria](/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria).

Yes! Apologies, I have been pretty tight with my schedule recently.

smith558 avatar Apr 09 '24 22:04 smith558

This pull request has merge conflicts that must be resolved before it can be merged.

github-actions[bot] avatar Apr 10 '24 00:04 github-actions[bot]

@bsmth , I made some slightly more extensive changes. It's still not great but better.

wbamberg avatar Apr 10 '24 02:04 wbamberg