how can I force cdn.rawgit.com use updated file

本秂侑毒 提交于 2019-12-23 06:57:37

问题


I am using cdn.rawgit.com to host some of my scripts and css for a project but I cannot refresh it. According to the FAQ:

Requests to cdn.rawgit.com are routed through MaxCDN's super fast content delivery network, and are cached permanently the first time they're loaded. This results in the best performance and reduces load on RawGit and on GitHub, but it means that reloading won't fetch new changes from GitHub.

Does this mean I can never refresh? Or is there a way to force a refresh to use the most recent version?


回答1:


Yes, permanent means never.

From the documentation:

Since files are not refreshed after the first request, it's best to use a specific tag or commit URL, not a branch URL.

This wouldn't update the file per-se, but it would allow you to specify the new version.




回答2:


I just created a page with github pages and I hosted the files there. You create a repository, in settings create the page then when you update the files it will automatically do it for you!




回答3:


It is impossible to refresh a cdn link. But there is a way of doing this.
Instead of specifying the URL directly:

https://github.com/<user>/<repo>/file.txt

you can make it tag specific like this one

https://github.com/<user>/<repo>/1.2/file.txt

So when you change the file, make a draft release and change the tag 1.2 to the tag release you made recently!




回答4:


Since rawgit.com is shutting down you want to use combinatronics.com it is an alternative for rawgit.com

It also automatically gets the latest file.



来源:https://stackoverflow.com/questions/23537239/how-can-i-force-cdn-rawgit-com-use-updated-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!