You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Maximum file size that storage should support #181
Moved from ServiceWorker spec discussion (w3c/ServiceWorker#1770) which only focuses on Cache Storage use case.
Summary of the original thread:
The storage file size historically had not been a big problem as typical use cases did not involve extremely large files.
Recently, however, the use of caching for Large Language Models (LLMs) has led to attempts to cache files larger than 2 GB.
For example, Chrome has a bug on opening 2 GB+ file in CacheStorage: https://crbug.com/391398191
It's not realistic to support infinite size, so it would be beneficial to specify a size limitation.
While my initial proposal would be around 100 - 200 GB, f this is a drastically increased an end user will much sooner arrive at the point where temporary storage needs to be cleared by their user agent, potentially nullifying the benefit.
4GB (which is coming from int32_t max) might be a good option while it's likely that this limitation would be not enough for LLMs use cases.
Also, we need to think about the testing as well. We don't want to (if not "cannot") introduce a WPT with loading very large files.
To move the discussion on this issue forward, I'd like to make a concrete proposal.
Option A: 4GB
Pros:
It's likely that many implementations have bugs around int32_t limits. A 4GB limit would help identify and fix these bugs.
Cons:
As I pointed out, with use cases already exceeding 2GB, a 4GB limit might not be sufficient for future needs like caching LLM models.
Option B: 100GB
Pros:
This would be more future-proof and accommodate use cases like LLMs.
This is technically feasible, as Chromium's implementation already has a mechanism to support this size.
Cons:
As @annevk mentioned, this could lead to the user agent clearing temporary storage more quickly, potentially nullifying the benefit of caching.
A Note on Testing
As @asutherland pointed out, running WPTs with very large files is impractical.
One solution could be to mandate support for large files (e.g., 4GB + 1 byte) in the specification, while using a smaller, test-only quota in WPTs to efficiently test the logic around the limit.
Questions for the group:
Between options A and B, which do you find more reasonable?
Are there other limits or approaches we should consider?
Is the proposed approach to testing acceptable?
Personally, I am in favor of Option B. I agree with @fergald's point from the original thread. Developers are already storing large files, but in non-ergonomic ways like breaking them into chunks in IndexedDB. Given that this is a legitimate and common use case, we should make it ergonomic. Formal support in CacheStorage would improve the situation.
Activity
elkurin commentedon May 20, 2025
+cc @domenic @annevk @youennf @asutherland @fergald @yoshisatoyanagisawa
elkurin commentedon Dec 2, 2025
Hi all,
To move the discussion on this issue forward, I'd like to make a concrete proposal.
Option A: 4GB
int32_tlimits. A 4GB limit would help identify and fix these bugs.Option B: 100GB
A Note on Testing
As @asutherland pointed out, running WPTs with very large files is impractical.
One solution could be to mandate support for large files (e.g., 4GB + 1 byte) in the specification, while using a smaller, test-only quota in WPTs to efficiently test the logic around the limit.
Questions for the group:
Personally, I am in favor of Option B. I agree with @fergald's point from the original thread. Developers are already storing large files, but in non-ergonomic ways like breaking them into chunks in IndexedDB. Given that this is a legitimate and common use case, we should make it ergonomic. Formal support in CacheStorage would improve the situation.
I look forward to hearing your thoughts.
annevk commentedon Dec 2, 2025
cc @szewai