如何从 CDN 加载静态 mediawiki 内容?
出于显而易见的原因(使用 MW 1.17.0),我想从内容交付网络(CDN)加载所有 MedaiWiki 静态资源。
我想我需要设置 $wgStylePath=http://cdn.example.com/ 然后将所有内容放在当前在我的 /skins/ 目录中进入 http://cdn.example.com/ (这似乎是在这个 Stack Overflow 问题/答案中建议的:如何更改 mediawiki 中的图像 src 属性以访问 CDN? 但不是很清楚
我关心的是当前位于 /skins/ 目录中的 .php 文件...
我唯一的想法是我需要将 /skins/ 中的所有子目录放入 CDN,但不是直接位于 /skins/ 中的 .php 文件
也许我的处理方式是错误的...有吗有更好的方法来实现我想要做的事情吗?(我希望从外部 CDN 加载所有与主题相关的 .js、.css 和图像文件)
谢谢,
-Dan
I'd like to load all the MedaiWiki static resources from a Content Delivery Network (CDN) for obvious reasons (using MW 1.17.0).
I think I need to set $wgStylePath=http://cdn.example.com/ Then put everything currently in my /skins/ directory into http://cdn.example.com/
(this appears to be suggested in this Stack Overflow question/answer: How can you change images src attributes in mediawiki to access a CDN? but it's not very clear
My concern is the .php files that are currently in the /skins/ directory...
My only thought is that I need to put all the sub-directories from /skins/ into the CDN, but not the .php files that are directly in /skins/
Maybe I'm going about this the wrong way... is there a better way to achieve what I'm trying to do? (I'd like all the theme related .js, .css and image files to load from the external CDN)
Thanks,
-Dan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里有两个完全不同的路径:网络服务器访问皮肤相关PHP文件的文件系统路径($wgStyleDirectory) 和将放置在 HTML 代码中并由浏览器用来访问 css/js 文件的 URL ($wgStylePath)。如果您想使用 CDN,则将后者设置为 CDN url,而不要管前者。
There are two completely different paths here: the filesystem path through which the webserver accesses skin-related PHP files ($wgStyleDirectory) and the URL which will be placed in the HTML code and used by the browser to access css/js files ($wgStylePath). If you want to use a CDN, you set the latter to the CDN url and leave the former in peace.