title: Service worker caching with workbox and server-side rendered SPA
body: <p>I have a server-side rendered react app and I want to add service worker caching to it. </p>
  
  <p>In the app users can login and see their saved settings. On initial load the server serves the app with these settings pre-rendered based on auth cookie. If user is not logged in then server pre-renders login form instead. </p>
  
  <p>If I use default cache-first strategy on the homepage index.html , then when user logs out and refreshes page, they will see the cached version where they were still logged in.</p>
  
  <p>Using network-first strategy on index.html solves this problem partially, but it fails in this scenario: user logs out or changes any of their settings , goes offline and then refreshes the page - they would see cached version as if none of their actions ever happened, although they just saw the actual up to date version before refresh.</p>
  
  <p>One solution I can think of is to update index.html cache each time a non-GET request happens - logout would have to be a DELETE request, for example. This would solve everything actually and might be universal enough to be included in the framework. </p>
  
  <p>Anyway, I guess I can figure out how to listen to non-GET requests with workbox , but how can I update index.html cache in the listener?</p>
  
  <p>I'll continue inspecting workbox source code, but I would love to get a hint, thanks in advance! </p>