search

Home  >  Q&A  >  body text

Read cleared cache data

<p>I have a module test: </p> <pre class="brush:php;toolbar:false;">var myCache = await caches.open("test"); // Create a new cache await myCache.add(new Request("/index.html")); // The page is successfully stored await caches.delete("test"); myCache.match("/index.html"); // I can still read from the deleted cache! </pre> <p>After deleting the cache, I can't see it in the browser inspector anymore, but I can still get the response via the <code>.match</code> method. Here I am expecting an error, please explain this unexpected behavior. </p>
P粉556159786P粉556159786474 days ago534

reply all(1)I'll reply

  • P粉068174996

    P粉0681749962023-08-10 12:46:52

    There seems to be confusion about the description of CacheStorage.delete on the MDN website. Actually, the object is not deleted. The W3C specification specifies that cacheJobPromise will only delete the key in the map, not the object itself.

    reply
    0
  • Cancelreply