camptocamp / ogc-client

A TypeScript library for interacting with geospatial services
https://camptocamp.github.io/ogc-client/
BSD 3-Clause "New" or "Revised" License
66 stars 12 forks source link

Handle the case where the Cache Storage is not reachable. #15

Closed fgravin closed 11 months ago

fgravin commented 11 months ago

OGC client internally uses the Browser Cache Storage abilities to cache the requests.

Issue In some cases, for instance on Firefox in Privacy Mode, we are not allowed to read or write in the cache storage. It results that the OGC client fails requesting the cache, but still does not perform the original request.

It triggers the following error

Uncaught (in promise) DOMException: **The operation is insecure**.
    4505 https://www.datagrandest.fr/datahub/main.7acf17b8ce68852b.js:133
    r https://www.datagrandest.fr/datahub/runtime.4381662fc90e13c0.js:1
    <anonymous> https://www.datagrandest.fr/datahub/main.7acf17b8ce68852b.js:133
    n https://www.datagrandest.fr/datahub/runtime.4381662fc90e13c0.js:1
    <anonymous> https://www.datagrandest.fr/datahub/main.7acf17b8ce68852b.js:1

Todo Handle the case where the Cache Storage is not accessible and performs original requests without caching

jahow commented 11 months ago

Indeed, see https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage