0

I'm working on an older Aurelia application running aurelia-cli v1.3.1 and requirejs v2.3.2 and am experiencing some browser caching headaches. Clients are reporting that old content is showing and/or the application hangs after a deployment. I've deduced that Chrome and other popular browsers are caching the bundle files from previous versions. Browser hangs are caused by older (versioned) bundles being cleaned up after each deployment.

I've tried the following:

  1. Enable revisions in the options section of under build of the aurelia.json file
    enter image description here
  2. Execute a PowerShell script to delete old bundles on the server during the deploy.
  3. Execute a PowerShell script to delete old index.html file on the server during the deploy.

The bundles are being versioned correctly as per this screenshot after a build:
enter image description here

However, the same issues persist. I figured maybe the index.html was being cached so that led me to pursue point 3 above. The project is due for an upgrade and more recent versions of the aurelia-cli paired with webpack seem to handle this issue more reliably, but for the mean time until the upgrade, is there anything more I can do to prevent browser caching?

Thanks!

JP Damstra
  • 545
  • 7
  • 25
  • At the level of bundles, it's okay to use the rev mode to produce unique filenames. The index.html file get always the same name and for this you should define that file at the level of the web server to be not cached or with a short expiration time. – Cristián Ormazábal Sep 03 '21 at 13:36
  • @CristiánOrmazábal Interesting. I'll check out what IIS has set for that file. – JP Damstra Sep 03 '21 at 13:46
  • Here [link](https://stackoverflow.com/a/26666450/11493447) is a config for IIS. – Cristián Ormazábal Sep 03 '21 at 15:16

0 Answers0