Skip to content

Conversation

@Shiva903-hue
Copy link

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

Copy link
Contributor

@breautek breautek left a 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:

  1. LocalStorage
  2. IndexedDB
  3. Cache Storage
  4. Plugin-Based Options

Copy link
Contributor

@GitToTheHub GitToTheHub left a 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 CacheStorage has 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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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

Comment on lines +212 to +213
- **Android (Chromium WebView):** Behavior is generally similar to Chrome, but may
vary depending on the WebView version shipped with the device.
Copy link
Contributor

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?

Comment on lines +214 to +215
- **iOS (WKWebView):** Cache Storage persistence is more restrictive, and cached
data may be evicted more aggressively by the system.
Copy link
Contributor

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.

Comment on lines +216 to +218
- **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.
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would write

### 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants