有什么方法可以将 Minify 与外部(CDN 托管)样式表和脚本一起使用吗?
我希望使用 http://code.google.com/p/minify/ - 缩小 - 它看起来真的很棒。然而,我似乎无法弄清楚让它接受外部样式表和 JS 脚本文件的方法,尤其是使用 Builder。
我在 Amazon S3 上托管文件,但在我的域上设置了 CNAME 记录,以便可以从 cdn.mydomain.com
访问它们 - 难道真的没有办法使用 Minify 来做到这一点吗?
杰克
I'm hoping to use http://code.google.com/p/minify/ - Minify - and it looks really good. However I can't seem to fathom a way to get it to accept external stylesheets and JS script files, especially with the Builder.
I am hosting files on Amazon S3 but have set up a CNAME record on my domain so they are accessible from cdn.mydomain.com
- is there really no way to do it with Minify?
Jack
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
别费心了... Minify 对于有条件包含多个 CSS 文件的 CMS 系统很有用,并且由那些对 CSS 毫无了解但仅 CDN 或任何其他 TLA 的人使用...但是如果您使用单个网站,甚至一系列网站,这是不值得的。如果没有...,这很容易做到
。您可以做两件事之一。每次更新生产站点时,要么虔诚地更新所有 CSS 文件的压缩版本,要么编写一个构建脚本来为您执行此操作(如果需要,您可以在预提交时调用它)...
此外,如果您有当您需要 CDN 的流量级别时,您不希望为每个 css 或 js 请求加载 PHP 的开销(即使它只是从缓存中提取)。手动执行,或在构建脚本中以编程方式执行,然后完成...
Don't bother... Minify is useful for CMS systems that have conditional inclusion of multiple CSS files, and are used by people who have no clue about CSS yet alone CDNs or any other TLA... But if your working with a single site, or even a series of sites, it's not worth it. It's easy enough to do without...
You could do one of two things. Either religiously update a compressed version of all the CSS files each time you update your production site, or write a build script to do that for you (you can call it on pre-commit if you want)...
Besides, if you have the traffic levels where you need a CDN, you don't want the overhead of loading PHP for every single css or js request (even if it is just pulling from cache). Do it either manually, or programmaticly in a build script and be done with it...
老话题,但我认为贡献可以帮助其他人:Minify : CustomSource
Old topic but I think the contribution can help other folks :Minify : CustomSource