Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching of the .json config file #106

Open
cphorton opened this issue Mar 8, 2018 · 3 comments
Open

Caching of the .json config file #106

cphorton opened this issue Mar 8, 2018 · 3 comments

Comments

@cphorton
Copy link

cphorton commented Mar 8, 2018

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.

@djensen47
Copy link

+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.

@cphorton
Copy link
Author

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.

@Vheissu
Copy link
Owner

Vheissu commented Dec 3, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants