-
Notifications
You must be signed in to change notification settings - Fork 565
docs: document Cache Storage behavior in Cordova WebViews #1455
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
base: master
Are you sure you want to change the base?
Conversation
breautek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the Cache section text and wording is fine but it was placed in the middle of the IndexedDB section.
I think the block should be moved to just before ## Plugin-Based Options so that the level 2 headers are as follows:
- LocalStorage
- IndexedDB
- Cache Storage
- Plugin-Based Options
GitToTheHub
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Sometimes it sounds like
CacheStoragehas something to do with Cordova, but it's not. - Some other things I noted
| resource caching and offline-read scenarios, and is often associated with | ||
| Service Worker–based caching strategies. | ||
|
|
||
| ### Availability in Cordova |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sounds like this is something related Cordova, but it's not. It should be just Availability
|
|
||
| Cache Storage is exposed via the standard `window.caches` interface when supported | ||
| by the underlying WebView implementation. Availability and behavior depend entirely | ||
| on the platform WebView, and the API may not be available on all Cordova platforms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and the API may not be available on all Cordova platforms: This sounds also, like this has something to do exclusively with Cordova but it's not. Maybe it could be and the API may not be available on all Cordova supported platforms
|
|
||
| ### Platform behavior and caveats | ||
|
|
||
| Behavior of Cache Storage in Cordova applications can differ from typical desktop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Behavior of Cache Storage in Cordova applications can differ from typical desktop could be Behavior of Cache Storage in mobile applications can differ from typical desktop
| - **Android (Chromium WebView):** Behavior is generally similar to Chrome, but may | ||
| vary depending on the WebView version shipped with the device. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be explained further what but may vary depending on the WebView version shipped with the device.? An example maybe?
| - **iOS (WKWebView):** Cache Storage persistence is more restrictive, and cached | ||
| data may be evicted more aggressively by the system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this mean is more restrictive and cached data may be evicted more aggressively by the system.. An example would be good to explain, what this means.
| - **Origin and scheme sensitivity:** Access to cached data is origin-dependent. | ||
| Changes to the application origin, scheme, or WebView implementation may prevent | ||
| access to previously stored cache entries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CacheStorage notes also:
This feature is available only in secure contexts (HTTPS)
This should be added.
Also it could be added what the minimum Platform is:
- Android: Android WebView version 65, Android 5.0
- iOS: 11.3
(Source: https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage#browser_compatibility)
|
|
||
| ### References | ||
|
|
||
| - [MDN: Cache Storage API](https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would write
- MDN: CacheStorage API - Handles all caches
| ### References | ||
|
|
||
| - [MDN: Cache Storage API](https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage) | ||
| - [MDN: Using the Cache API](https://developer.mozilla.org/en-US/docs/Web/API/Cache) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here:
- MDN: Cache API - Work with a single cache
This PR adds a Cache Storage subsection to the existing storage documentation.
It summarizes the web-standard Cache Storage API and documents how it behaves
inside Cordova WebViews, with a focus on platform-specific caveats (Android and iOS),
persistence expectations, and guidance on appropriate usage.
This documentation intentionally avoids positioning Cache Storage as a Cordova
feature and instead aligns with existing storage sections.
References #1210