admin管理员组文章数量:1291172
I have a js file stored here in GitHub.
// Define the function before setup() i.e. at the top if defining in same js file
// Call the function under draw()
function pointCoord() {
stroke(255,0,0);
line(mouseX,0, mouseX, height);
line(0,mouseY, width, mouseY);
if (mouseIsPressed){console.log(`x = ${mouseX}, y = ${mouseY}`);}
}
This is its jsdelivr link: @main/Tools/x-y-coordinate%20pointer.js
// Define the function before setup() i.e. at the top if defining in same js file
// Call the function under draw()
function pointCoord() {
stroke(255,0,0);
line(mouseX,0, mouseX, height);
line(0,mouseY, width, mouseY);
if (mouseIsPressed){print("x = "+ mouseX+ ", y = "+mouseY);}
}
(If you are curious this doesn't look like Vanilla JS code..this file is meant to be used under the p5.js library)
As you would see, the last line on both pages is different. Actually, the jsdelivr page doesn't show the content updated with the previous 2 mits on GitHub - and it's over 10 hours since I have mitted them.
Now how do I update the code in jsdelivr CDN?
I have a js file stored here in GitHub.
// Define the function before setup() i.e. at the top if defining in same js file
// Call the function under draw()
function pointCoord() {
stroke(255,0,0);
line(mouseX,0, mouseX, height);
line(0,mouseY, width, mouseY);
if (mouseIsPressed){console.log(`x = ${mouseX}, y = ${mouseY}`);}
}
This is its jsdelivr link: https://cdn.jsdelivr/gh/JaPatGitHub/EduSimulations@main/Tools/x-y-coordinate%20pointer.js
// Define the function before setup() i.e. at the top if defining in same js file
// Call the function under draw()
function pointCoord() {
stroke(255,0,0);
line(mouseX,0, mouseX, height);
line(0,mouseY, width, mouseY);
if (mouseIsPressed){print("x = "+ mouseX+ ", y = "+mouseY);}
}
(If you are curious this doesn't look like Vanilla JS code..this file is meant to be used under the p5.js library)
As you would see, the last line on both pages is different. Actually, the jsdelivr page doesn't show the content updated with the previous 2 mits on GitHub - and it's over 10 hours since I have mitted them.
Now how do I update the code in jsdelivr CDN?
Share Improve this question edited Aug 27, 2021 at 13:44 Jyotiraditya Pradhan asked Aug 27, 2021 at 13:35 Jyotiraditya PradhanJyotiraditya Pradhan 531 silver badge5 bronze badges 1-
1
Pretty in-depth answer to this question in a jsdelivr issue opened on Github: "If you use a @main reference the releases are not relevant at all and it follows the branch caching behavior. If you used @latest the release caching behavior would apply (note that it's "up to 7", not "strictly 7" in that case)" and
@latest
currently takes up to 12 hours. – ruffin Commented Nov 8, 2023 at 20:42
2 Answers
Reset to default 6You can use the following link to retrieve the latest version of your code from jsDelivr: https://cdn.jsdelivr/gh/JaPatGitHub/EduSimulations@latest/Tools/x-y-coordinate%20pointer.js
By using @latest in the link, you're instructing jsDelivr to serve the most recent version available in the repository, regardless of the branch name.
From jsDelivr's website regarding GitHub CDN
We use a permanent S3 storage to ensure all files remain available even if GitHub goes down, or a repository or a release is deleted by its author. Files are fetched directly from GitHub only the first time, or when S3 goes down.
Use a release (or some other named) branch and then access that branch from jsDelivr.
本文标签: javascriptjsdelivr doesn39t update github commitsStack Overflow
版权声明:本文标题:javascript - jsdelivr doesn't update github commits - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741523321a2383318.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论