search

Home  >  Q&A  >  body text

angular.js - Web application, single page application Cache question

Does anyone know how to make the client go to the server to download the latest CSS and js after a website or web application is updated to a new version, instead of reading it from the cache?

After searching on my own, most suggestions are to add a version number in the middle or at the end of the CSS and JS file names, such as main.123456.min.css or main.min.css? version=123456.

If anyone has practical experience in this area, please enlighten me! Many thanks!

習慣沉默習慣沉默2790 days ago516

reply all(2)I'll reply

  • 迷茫

    迷茫2017-05-15 17:11:12

    Use packaging tools such as webpack to automatically version assets for static resources.

    reply
    0
  • 为情所困

    为情所困2017-05-15 17:11:12

    For example main.123456.min.css or main.min.css? version=123456

    There is nothing wrong with this, I do it too. Caching is an optimization

    reply
    0
  • Cancelreply