mapbox/mapbox-gl-js
Voir sur GitHubWhen Cache API is not available, dont clone response for `cachePut`
Open
#8 416 ouverte le 1 juil. 2019
bug :lady_beetle:good first issue
Métriques du dépôt
- Stars
- (10 532 stars)
- Métriques de merge PR
- (Aucune PR mergée en 30 j)
Description
The cacheGet method calls back to validateOrFetch with a null error if window.caches is not available. From what I can tell, this could happen when the Cache API is not available at all or if a page is served over http and the Cache API is not usable.
In this case validateOrFetch still calls clones the response and attempts to place it in the cache.
If it is known that window.caches is no available or usable, there is not need to clone the response or to load its contents: