What is the storage limit for a service worker?

前端 未结 5 1980
耶瑟儿~
耶瑟儿~ 2020-11-28 03:59

Most of the browsers provide localStorage with the storage limit of 5MB per domain. Are there such memory limits/constraints with respect to service workers?

I know

5条回答
  •  日久生厌
    2020-11-28 04:31

    There's no explicit limit. All modern browsers are multi-process or similar, so a badly-designed page (or SW) won't do anything worse than crash itself.

    Note that the SW spec is very explicit about the browser being able to kill and restart the SW at any time, for any reason. (If DevTools is open on a page, Chrome purposely kills SWs for the page constantly, to encourage you to adopt good practices.)

提交回复
热议问题