After our magento 2 site is live whenever we are doing changes in JS file it doesn't reflect in customer browser as a result some of the pages breaks for those customer who doesn't flush his browser cache. Is there any way that browser will load fresh file from the server if there is any changes in the file.

Thanks in Advance I am facing this issue in magento 2


You can add a query string to your javascript file URL in order to take effect in your customer browsers. like below example.


Change your version when you make changes in your js file.

  • How you can do that in magento 2? – anjanbarik Jul 1 at 7:39
  • which js you want to take effect? is it magento default or your custom. – Rizwan Khan Jul 1 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.