aurelia-configuration icon indicating copy to clipboard operation
aurelia-configuration copied to clipboard

Caching of the .json config file

Open cphorton opened this issue 6 years ago • 3 comments

I had a situation where my config file was being cached locally in the browser and causing issues across multiple changes / releases.

I came up with the following solution and just wanted to clarify if this is the best way to combat the issue.

.plugin(PLATFORM.moduleName('aurelia-configuration'), config =>{
        config.setConfig('config.json?v=' + Guid.raw());
      })

As you can see I am using the Guid library to get a unique reference.

If this is indeed an appropriate way to deal with the issue, perhaps it is something that could be built into the plugin itself.

cphorton avatar Mar 08 '18 00:03 cphorton

+1 for adding this to the library.

Caching busting really should be addressed by the library. Unless I'm mistaken, there doesn't even appear to be a way to bundle the json config file into the app-bundle.

djensen47 avatar Mar 20 '18 05:03 djensen47

I am pretty comfortable with the config file being outside of the app-bundle. It works well with our deployment process as the build artifacts remain the same and we simple change the config based on the different deployment targets, so having it outside of the app-bundle helps us with this process.

cphorton avatar Mar 22 '18 02:03 cphorton

This aspect is currently being streamlined. I am going to make the library bundler compatible so the JSON file is bundled in say an application using Webpack. Also, sorry for the delay.

Vheissu avatar Dec 03 '18 00:12 Vheissu