Thursday, October 5, 2017

Auto Versioned Files Still Requires Refresh

I am working on a live, large AngularJS web application which has feature updates and hotfixes. We currently use gulp to build/minify/uglify our files as well as gulp-rev to add versioning to these files to assure our users have the latest files. This seems to work well, except when I go to our production site to make sure the change was made, I have to refresh the page before Chrome downloads/uses the correct files.

My question is, is this what’s expected to happen? Is there no way for Chrome to know to download the newest file without needing a refresh?

For more details, our current workflow is the following:

  1. Make the changes
  2. Run gulp build
    • combine all our js files into a single app-random-hash.js
    • combine all our css files into a single app-random-hash.css
  3. Copy the files into /var/www/
  4. Delete old, stale files
  5. I visit the website and still have the old app.js file until i refresh the page, at which point i get the newest .js file

Source: AngularJS



from Angular Questions https://angularquestions.com/2017/10/05/auto-versioned-files-still-requires-refresh/
via @lzomedia #developer #freelance #web #lzomedia.com

No comments:

Post a Comment