Skip to content

Instantly share code, notes, and snippets.

@ritikrishu
Created March 11, 2018 21:18
Show Gist options
  • Save ritikrishu/7ababce149c06f6d08e7863d9008fd3e to your computer and use it in GitHub Desktop.
Save ritikrishu/7ababce149c06f6d08e7863d9008fd3e to your computer and use it in GitHub Desktop.
finding if a cache name exists in CacheStorage
/**
Suppose CacheStorage these named cache - "name 1", "Some-other-name"
*/
console.log(
await caches.has("name 1")
)// <- true
console.log(
await caches.has("name 2")
)// <- false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment