July 2018
Intermediate to advanced
354 pages
8h 51m
English
The delete method searches for a cache matching the name supplied. If a matching cache is found, it is deleted. A promise is returned that resolves true if a matching cache was deleted or false if one was not deleted:
Cached.delete(cacheName).then((ret)=>{ console.log(cacheName + " deleted: " + res});
You don't always need to add code to handle the response. Typically, you would log the activity. If no cache was deleted, it is most likely due to the cache not existing, which in that case you probably have nothing to worry about.
You should also note that if you delete a cache, all of the cached items are deleted along with it.
Read now
Unlock full access