I have PWA app in which I am rendering js files using Webpack:
{% render_bundle 'app' 'js' %}
After launching the PWA app in mobile Chrome the file is not updated. Most probably Chrome uses cached version.
I tried to delete PWA app and install it again but it did not help.
Afterwards I have cleared the mobile Chrome cache manually and files were refreshed, however, most of the users won't do it so I need another solution which does not require any actions from end users.
Answers on similar question suggest to add parameter or version number to the js file.
<script type="text/javascript" src="myfile.js?REVISION"></script>
However, it is not clear how can I do it using Webpack?
One more popular answer explains that I can use hash or chunkhash to generate file name using Webpack:
output: {
path: '/',
filename: '[hash].js',
chunkFilename: '[chunkhash].js',
},
This solution won't work for me because I cannot change the name of the file every time when there are some chnages in it. The name of the file should stay the same because I use django's collectfast app. It checks the md5sum of static files and updates only those ones which have been changed.
The name of the static js file should stay the same. At the same time, I need mechanism which will force mobile Chrome to update changed file.