I have tried two different ways and both do not work:
1. Update the manifest so browser sees there's changes and updates
This updates all files except JavaScript files. The browser sees there's a difference, downloads everything (including JavaScript files) but uses the cached version of the JavaScript files.
2. Send no-cache headers (see code below) to stop caching of script files
This causes the browser to throw an error and no longer cache anything. It says an ApplicationCache error occurred.
The no-cache code:
<filesMatch "\.(js)$">
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</filesMatch>
The above makes all browsers not cache the app for offline use.
Is there a way around this?