I deployed my php code to an app engine. Because of load balancing, requests sent to the app engine are automatically distributed to different servers. Since the assets folders on different servers are created automatically by Yii and their names are random and different, this causes asset folder mismatch problem. For example,
1. There is a page request, after load balancing it goes to SERVER_1, and the corresponding jquery folder is /assets/aaaaaa/jquery.js;
2. Then the browser send request to get the javascript file. However, this time the request goes to SERVER_2 after load balancing, but the file /assets/aaaaaa/jquery.js does not exist on SERVER_2 (for example, it might be /assets/bbbbbb/jquery.js).
Now I temporarily solved this problem by using URL write that redirects all requests sent to /assets/[random_number]/ to a static folder /assets/static/. I think this is not a good solution due to its lack of flexibility.
Is there any way to avoid this problem? Many thanks.
Page 1 of 1
How To Keep Assets Folders Synchronized On Different Machines?
#2
Posted 05 February 2013 - 03:53 PM
I have the same problem. I use Yii whith nodejs, mongodb on CentOS VMs.
#3
Posted 06 February 2013 - 06:55 AM
Just brainstorming here, but wouldn't it be possible to extend CAssetManager, override generatePath and then class map the new class to CAssetManager?
#4
Posted 23 April 2013 - 03:27 AM
Hey ,
i have the same problem.
i am using load balancer with yii behind. what is the best solution ? rewrite the AssetManger ?
yii is not supporting a load balancer use ? really ?
i have the same problem.
i am using load balancer with yii behind. what is the best solution ? rewrite the AssetManger ?
yii is not supporting a load balancer use ? really ?
#5
Posted 30 April 2013 - 06:59 AM
One of the workarounds is to use Sticky sessions in load balancer.
Another workaround would be to use CDN for your assets.
Another workaround would be to use CDN for your assets.
Share this topic:
Page 1 of 1

Help












