How to get rid of browser caching issue of javascript file in magento 2How to force flush CSS cache on client side?CSS Caching.. Where is it hiding?Live site blank in frontend or keep on loading and never loadLeverage browser caching having Varnish installedMagento 2: Reflect CSS Changes Directlymagento 1.9.3.2 doesn't load CSS and JS on frontend and backend after some intense processlocal project url redirected to live project (project url import issue)Strange (browser) caching issue in cartMagento 2 static file paths incorrect after migrationCan't recuperate the css and javascript magento 2

Intern not wearing safety equipment; how could I have handled this differently?

E12 LED light bulb flickers when OFF in candelabra

Category-theoretic treatment of diffs, patches and merging?

How did the IEC decide to create kibibytes?

Why did Robert F. Kennedy loathe Lyndon B. Johnson?

How can I use my cell phone's light as a reading light?

What was the significance of Spider-Man: Far From Home being an MCU Phase 3 film instead of a Phase 4 film?

Quotients of a ring of integers

How do resistors generate different heat if we make the current fixed and changed the voltage and resistance? Notice the flow of charge is constant

Why SQL does not use the indexed view?

Sense of humor in your sci-fi stories

Uniform initialization by tuple

Why is a mixture of two normally distributed variables only bimodal if their means differ by at least two times the common standard deviation?

Derivatives Problem: Why is second term's coefficient less than zero?

Did William Shakespeare hide things in his writings?

The Apéry's constant and the Airy function

What does "spinning upon the shoals" mean?

Can a USB hub be used to access a drive from two devices?

Why do airports remove/realign runways?

Was the 45.9°C temperature in France in June 2019 the highest ever recorded in France?

Possibility to correct pitch from digital versions of records with the hole not centered

What was the nature of the known bugs in the Space Shuttle software?

stuck on a complex number problem

Need a non-volatile memory IC with near unlimited read/write operations capability



How to get rid of browser caching issue of javascript file in magento 2


How to force flush CSS cache on client side?CSS Caching.. Where is it hiding?Live site blank in frontend or keep on loading and never loadLeverage browser caching having Varnish installedMagento 2: Reflect CSS Changes Directlymagento 1.9.3.2 doesn't load CSS and JS on frontend and backend after some intense processlocal project url redirected to live project (project url import issue)Strange (browser) caching issue in cartMagento 2 static file paths incorrect after migrationCan't recuperate the css and javascript magento 2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















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










share|improve this question
























  • You have tried versioning? mage2.pro/t/topic/3476

    – Rizwan Khan
    Jun 28 at 12:02












  • We can't add versioning in production site

    – anjanbarik
    Jun 28 at 12:06











  • You want to refresh only one javascript file when your js changes?

    – Rizwan Khan
    Jun 28 at 12:09











  • Anything will work.

    – anjanbarik
    Jun 28 at 12:19

















0















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










share|improve this question
























  • You have tried versioning? mage2.pro/t/topic/3476

    – Rizwan Khan
    Jun 28 at 12:02












  • We can't add versioning in production site

    – anjanbarik
    Jun 28 at 12:06











  • You want to refresh only one javascript file when your js changes?

    – Rizwan Khan
    Jun 28 at 12:09











  • Anything will work.

    – anjanbarik
    Jun 28 at 12:19













0












0








0








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










share|improve this question
















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







magento2 javascript cache browser






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 28 at 12:05









Rizwan Khan

1,0851 gold badge7 silver badges27 bronze badges




1,0851 gold badge7 silver badges27 bronze badges










asked Jun 28 at 11:55









anjanbarikanjanbarik

164 bronze badges




164 bronze badges












  • You have tried versioning? mage2.pro/t/topic/3476

    – Rizwan Khan
    Jun 28 at 12:02












  • We can't add versioning in production site

    – anjanbarik
    Jun 28 at 12:06











  • You want to refresh only one javascript file when your js changes?

    – Rizwan Khan
    Jun 28 at 12:09











  • Anything will work.

    – anjanbarik
    Jun 28 at 12:19

















  • You have tried versioning? mage2.pro/t/topic/3476

    – Rizwan Khan
    Jun 28 at 12:02












  • We can't add versioning in production site

    – anjanbarik
    Jun 28 at 12:06











  • You want to refresh only one javascript file when your js changes?

    – Rizwan Khan
    Jun 28 at 12:09











  • Anything will work.

    – anjanbarik
    Jun 28 at 12:19
















You have tried versioning? mage2.pro/t/topic/3476

– Rizwan Khan
Jun 28 at 12:02






You have tried versioning? mage2.pro/t/topic/3476

– Rizwan Khan
Jun 28 at 12:02














We can't add versioning in production site

– anjanbarik
Jun 28 at 12:06





We can't add versioning in production site

– anjanbarik
Jun 28 at 12:06













You want to refresh only one javascript file when your js changes?

– Rizwan Khan
Jun 28 at 12:09





You want to refresh only one javascript file when your js changes?

– Rizwan Khan
Jun 28 at 12:09













Anything will work.

– anjanbarik
Jun 28 at 12:19





Anything will work.

– anjanbarik
Jun 28 at 12:19










1 Answer
1






active

oldest

votes


















0














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



http://yourdoamin/js/youjs.js?version=1.1


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



http://yourdoamin/js/youjs.js?version=1.2





share|improve this answer

























  • 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








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f280084%2fhow-to-get-rid-of-browser-caching-issue-of-javascript-file-in-magento-2%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














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



http://yourdoamin/js/youjs.js?version=1.1


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



http://yourdoamin/js/youjs.js?version=1.2





share|improve this answer

























  • 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
















0














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



http://yourdoamin/js/youjs.js?version=1.1


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



http://yourdoamin/js/youjs.js?version=1.2





share|improve this answer

























  • 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














0












0








0







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



http://yourdoamin/js/youjs.js?version=1.1


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



http://yourdoamin/js/youjs.js?version=1.2





share|improve this answer















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



http://yourdoamin/js/youjs.js?version=1.1


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



http://yourdoamin/js/youjs.js?version=1.2






share|improve this answer














share|improve this answer



share|improve this answer








edited Jun 28 at 12:31

























answered Jun 28 at 12:08









Rizwan KhanRizwan Khan

1,0851 gold badge7 silver badges27 bronze badges




1,0851 gold badge7 silver badges27 bronze badges












  • 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


















  • 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

















How you can do that in magento 2?

– anjanbarik
Jul 1 at 7:39





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






which js you want to take effect? is it magento default or your custom.

– Rizwan Khan
Jul 1 at 11:04


















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f280084%2fhow-to-get-rid-of-browser-caching-issue-of-javascript-file-in-magento-2%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form