2

I have made a change in opcheckout.js file but the change is not reflected in frontend. I have flushed magento cache, cache storage, Javascript/CSS cache, Purged Varnish but the change is not at all reflecting in the frontend. I inspected the element and looked into the JS file and it shows the older one in firebug. Can anyone please tell me some way to get the change done in JS file to be reflected in live?

1 Answer 1

1

One thing you can try is to merge css and js files and also you can add a version to your js and css files, so then the file will look like this ie: opcheckout.js?v=something

You can do this here: Versioning:

System -> Configuration -> General -> Design -> CSS/JS Design Versions

CSS settings:

System -> Configuration -> Developer -> CSS settings -> Merge CSS Files

Also take a look to this extension, it will add the last-modified timestamp to your js and css files: https://github.com/fbrnc/Aoe_JsCssTstamp

4
  • @Amit Bera: my site has been upgraded from 1.8 to 1.9. Within due course of time, opcheckout.js faced some addition of lines if compared with old file due to which a functionality for customer credit stopped working in my case, so I just made a minor change in js file and uploaded to the same location. I dont want to give versioning to js file, is it something that it is old opcheckout.js is cached somewhere might be in server? Any idea Commented Nov 5, 2015 at 11:07
  • I accept your answer as because I tried to change JS file version and it worked..To me it seems like old JS file remains cached until it founds some new file like I added this line: <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/opcheckout.js?v1') ?>"></script> in my .phtml file Commented Nov 5, 2015 at 15:26
  • Yes that is how it works. When magento adds the version to the file then for the browser is a new file
    – lloiacono
    Commented Nov 5, 2015 at 16:16
  • thanks man for the support, now I feel that I took a right step Commented Nov 5, 2015 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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