One solution is to add a version number to the end of the JS file name in your HTML code. This will force the browser to download the new version of the file instead of using the cached version. For example:
<script src="js/app.js?v=2"></script>
In this example, the version number is "2". Whenever you make changes to the JS file, you can increment the version number to force the browser to download the new version.
Another solution is to set the cache-control header for your JS files to "no-cache". This will tell the browser not to cache the file. You can do this in your server configuration or in your PHP code. For example, in PHP:
header("Cache-Control: no-cache, must-revalidate");
This will set the cache-control header for the current request. You can also set it for specific files by using the header() function in the file itself.