Hi Stefano,
Sorry you had to ping the list twice before getting an answer!
Your JavaScript won’t know your server file has changed, so you’ll need to either automatically expire your storage or use a few other approaches.
You can set an automatic caching length when you store the file:
amplify.store(storeKey, json, { expires: 24 * 60 * 60 * 1000 }); // cache for 24 hours
Another approach depends on when/how the i18n files change. If they change only when code that uses them changes, and all your JS is rebuilt – you can use a hard coded timestamp that you update in your JS (or as part of your build step) when your code should refresh the store.
You’d want to store that timestamp using amplify.store after checking if the hardcoded date is greater than the existing stored date. When you have updated the JS and i18n files, this date will be out of sync and you can clear out your i18n cache and reload it.
Or, if you are already versioning your JS, you could compare the version of the app with one you stored in amplify.store and automatically re-fetch the i18n files when the app version changes.
Hope some of these ideas give you a nice approach short of reaching out to your server to see if the file has changed.
Doug