If you're using Zend, you should first be restructuring your helpers so that the base url for resources (images, scripts etc) are taken from a config variable.
Make sure all the resources linked in your views/layouts either go through a helper or are prepended with the base url.
For your javascript libraries, I suggest you start pointing them to either Google or Microsoft. Here's the link for the Google JS CDN and here's the Microsoft CDN
Your next step would be to start serving the rest of your resources through a CDN. This depends on your host and your configuration. Amazon, for example has their own CDN so if you're running on EC2 you can use that. Basically look at the options your host offers.
There are lots of CDN options out there with differing options, some free, some not. See this entry on Wikipedia for a list of CDNs that are free/paid/p2p. Also, read the read of the article as a primer.
Setting up coral is not complex at all. You just need to craft your URL to point to their network. If you have already layout/view this is a trivial matter.
发布评论
评论(1)
如果您使用 Zend,您应该首先重组您的助手,以便从配置变量中获取资源(图像、脚本等)的基本 url。
确保视图/布局中链接的所有资源都通过助手或以基本 URL 开头。
对于您的 javascript 库,我建议您开始将它们指向 Google 或 Microsoft。这是 Google JS CDN 的链接,这是 Microsoft CDN
您的下一步是开始通过 CDN 提供其余资源。这取决于您的主机和配置。例如,亚马逊有自己的 CDN,因此如果您在 EC2 上运行,则可以使用它。基本上看看你的主机提供的选项。
有很多 CDN 选项,有不同的选项,有些是免费的,有些不是。请参阅维基百科上的此条目,获取免费/付费/p2p 的 CDN 列表。另外,请阅读这篇文章作为入门读物。
您可以立即开始做一些事情:http://www.coralcdn.org/
设置珊瑚一点也不复杂。您只需制作 URL 以指向他们的网络即可。如果您已经有了布局/视图,那么这是一件小事。
If you're using Zend, you should first be restructuring your helpers so that the base url for resources (images, scripts etc) are taken from a config variable.
Make sure all the resources linked in your views/layouts either go through a helper or are prepended with the base url.
For your javascript libraries, I suggest you start pointing them to either Google or Microsoft. Here's the link for the Google JS CDN and here's the Microsoft CDN
Your next step would be to start serving the rest of your resources through a CDN. This depends on your host and your configuration. Amazon, for example has their own CDN so if you're running on EC2 you can use that. Basically look at the options your host offers.
There are lots of CDN options out there with differing options, some free, some not. See this entry on Wikipedia for a list of CDNs that are free/paid/p2p. Also, read the read of the article as a primer.
And something you can start doing immediately : http://www.coralcdn.org/
Setting up coral is not complex at all. You just need to craft your URL to point to their network. If you have already layout/view this is a trivial matter.