title: Detecting a service worker eviction
body: <p>When a browser detects that storage is criticaly low, it can choose to evict a service worker's cache, as stated by the <a href="https://www.w3.org/TR/service-workers/#storage-considerations" rel="nofollow noreferrer">W3C doc</a>.</p>
  
  <p>Since my users can choose to store their bookings for offline acces, I want to warn them that the browser has deleted them. How can I detect from the page that my Service Worker has lost its cache and thus modifiy the UI accordingly?</p>
  
  <p>Usually, I adapt my UI to the presence or absence of my Service Worker by relying on <code>navigator.serviceWorker.register</code>. But in this case, the Service Worker is still registered, but cache-deprived.</p>
  
  <p>Reacting to the <code>onevicted</code> event is not enough, since the cache deletion could happen while the user is not even browsing my web site.</p>