Symfony2 Capistrano部署到CDN [英] Symfony2 Capistrano deploying to CDN

查看:178
本文介绍了Symfony2 Capistrano部署到CDN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Symfony2应用程序,我正在部署到使用Capistrano的开发,分期和生产服务器。但是,我也想设置一个CDN来提供静态内容,如图像,css,js文件等。例如CDN的URL是static.example.com。我读过,我只需要添加以下到我的config_prod.yml文件:

 框架:
模板:
引擎:['twig']
assets_base_urls:
http:[http://static.example.com]

但是,当使用capistrano进行部署时,我需要将整个应用程序部署到CDN以及将托管网站的服务器,或者只能部署资产,即图像,js文件等到CDN和动态文件到服务器/ s?



谢谢

解决方案

只有静态资产需要由您的CDN提供。



另请参见:
自动推送到CDN部署策略


I've got a Symfony2 application which I am deploying to development, staging and production servers using Capistrano. However, I'm looking to also setup a CDN to serve static content such as images, css, js files etc. The URL for the CDN for example is static.example.com. I've read that I simply need to add the following to my config_prod.yml file:

framework:
     templating:
         engines: ['twig']
         assets_base_urls:
         http: [http://static.example.com]

However, when deploying using capistrano would I need to deploy the whole application to the CDN as well as the server that will host the website or can I deploy only the assets i.e images, js files etc to the CDN and the dynamic files to the server/s?

Thanks

解决方案

Only static assets needs to be served by your CDN.

See also: automatic push to CDN deployment strategy

这篇关于Symfony2 Capistrano部署到CDN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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