Angular 5 with CacheStorage

后端 未结 2 1773
[愿得一人]
[愿得一人] 2021-01-23 16:43

im trying to use CacheStorage\'s promises in Angular 5 like in the docs :

let test = caches.open(\'test\');
    test.then((result : Cache) => {
      result.a         


        
2条回答
  •  闹比i
    闹比i (楼主)
    2021-01-23 17:20

    This is easy to miss -

    1) CacheStorage API (or Cache API) are only available on localhost and HTTP/2.
    2) For purists reason, prefer to use window.caches.open(CACHE_NAME) as caches is a singleton instance present in window object.

提交回复
热议问题