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

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

Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?