JSLink - SP not updating code [duplicate]
-
01-10-2020 - |
質問
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)
解決
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.
他のヒント
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.