0

The design of our website is such that whenever we make some changes in CSS & JavaScript files we require the user to clear the browser cache and get the latest version of these files from the server. This is highly undesirable from the user perspective and I don't see well designed websites out there having this issue.

Are there any website design best practices that can be followed to minimize this issue? Any pointers would be appreciated.

Xin
  • 21
  • 3
  • 1
    I think it is fairly safe to say that one common approach to this issue is that the hash of the css/js files is included in the file name at compilation. This ensures that when a change happens, the next time a user visits the site, the new file name is not matching anything in cache and is redownloaded. – Taplar Dec 28 '20 at 16:31

1 Answers1

0

Check out more on cache-busting. When you make changes to your css and javascript, you can append a version type to force the browser to reload the document.

Example:

<script src="myjavascript.js?v=1.1"></script>

<script src="myjavascript.js?v=1.2"></script>

etc : )

XLIME
  • 165
  • 6