0

This question already has an answer here:

I have a .js file stored on the Site Assets library. Today I updated it (uploaded file of the same Name and replaced the old one).

But the new code seemed not to work. After lot's of debugging and Troubleshooting, I discovered that it was not the code the problem.

I opened the Developer Tools (F12), selected the console tab and from the drop-down menu I selected my .js file which is linked to a library on the page. There I discovered the old code, before updating the file, which I found very weird.

Anyone encountered this before or have any idea why is that?

(I checked already the edit web part Options and the JSLink address is correct and also made sure the correct .js file is on the Site Assets library)

marked as duplicate by Robert Lindgren Jul 2 '15 at 14:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    It's probably a caching issue, have you tried a hard reload of the web page? Shift + refresh? – Eric Alexander Jan 2 '15 at 13:46
  • you were right about it was a cashing issue! hard reaload didn't help but private browsing did the trick :) – ConAchilleos Jan 2 '15 at 14:00
1

This seems like a caching issue.

JSLink (js)file is updated, but still can't see any changes, maybe caching?

Here the user resolved it by renaming the file name itself.

Another user reported that pressing "Ctrl + F5" has resolved his issue https://social.technet.microsoft.com/Forums/sharepoint/en-US/bc8a0ac0-2c2f-492c-a6b9-8de99d9799ab/jslink-js-file-in-the-masterpage-gallery-is-caching-the-old-version?forum=sharepointdevelopment

Also check this http://www.sharepointnutsandbolts.com/2011/11/avoiding-bugs-from-cached-javascript.html on how to avoid the caching issue.

  • Thanks for the help and info! Hard reload didn't do it, but opening the page in private browsing did the trick! saved me some headaches :) – ConAchilleos Jan 2 '15 at 13:59
  • @ConAchilleos you should be careful with this. From end users point of view they will not see the updates. Its always good to workaround this situation by following the last link I posted above. Cheers! – Amal Hashim Jan 2 '15 at 14:01
  • yep already tested with the users, they could not see the changes and "hotfixed" it by telling them to use the private browsing trick until I implement a permanent solution. Thanks again! Highly appreciated – ConAchilleos Jan 2 '15 at 14:27
0

I had the same issue in my environment. The following DIDN'T work: - Put script in "Style Library" - use (d) tag - CTRL+F5 - InPrivate

The only thing that finally worked --> turn off caching on your network infrastructure devices! When the caching on our NetScaler was turned off --> everything worked like a charm.

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