Skip to content

fix(build): 94 browser cache

CD Cabrera requested to merge 94-cache into master

What's included

  • fix(build): 94 browser cache

    • nginx expire html

Notes

reviewed gui generation for

  • manifest.json, Only handles ico/icon level files
  • service worker use, Currently not implemented
  • static resources, hashed on new build
  • nginx ...

Since the gui build scripts generate a hashed set of output files each time they're re-compiled this places them in more of the cache busting arena. One of the few files that doesn't seem to be handled as such is index.html. We came across something noted here:

  • https://github.com/facebook/create-react-app/issues/1910

    Based on this we could either attempt placing some old skool meta tags in the index.html

      <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
      <meta http-equiv="Pragma" content="no-cache" />
      <meta http-equiv="Expires" content="0" />

    Or attempt to update the nginx.conf,

      location ~ \.html$ {
          add_header Cache-Control "private, no-cache, no-store, must-revalidate";
          add_header Expires "Sat, 01 Jan 2000 00:00:00 GMT";
          add_header Pragma no-cache;
      }

    We opted for a more simplistic nginx change.

      location ~ \.html$ {
          expires -1;
      }

    The intention is that this may need to be iterated on.

Updates issue/story

updates #94 (closed)

Merge request reports