我们如何创建自己的CDN链接? [英] How can we create our own CDN links?

查看:105
本文介绍了我们如何创建自己的CDN链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我们有两个文件:style.css和stylejs.js。

Suppose we have two files: style.css and stylejs.js.

有没有一种方法可以为文件创建CDN链接,以便其他人可以使用像我们对bootstrap和angular一样,通过链接CDN链接来实现它?

Is there a way we can create a CDN link for our files so that others can use it by linking the CDN link just like we do for bootstrap and angular?

如果可以,有人可以告诉我如何实现吗?

If yes, can someone tell me how to achieve that?

推荐答案

如果您已经在自己的网站上使用这些文件,则可以轻松地提供这些文件的链接,例如 http://www.yoursite .com / path / to / your / file / style.js

If you are already using those files on your own website you can easily give links to those files like http://www.yoursite.com/path/to/your/file/style.js.

如果要继续提供其他版本,可以通过以下方法实现将版本号添加到文件中,例如 style.1.2.3.js 或将其保存在单独的目录中,例如 /v1.2/style.js

If you want to continue serving different versions you can achieve that by adding version numbers to your files like style.1.2.3.js or keeping them in separate directories like /v1.2/style.js.

另一种选择是使用某种CDN托管服务,例如 Cloudflare 。通过快速的Google搜索,您可以找到更多类似的服务。

The other option is to use some sort of CDN Hosting service like Cloudflare. You can find more services like this with a quick google search.

这篇关于我们如何创建自己的CDN链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆