This extension let you to add some random hosts to add this part equally distributed to have more responsive times in your server.
You can add a mirrors and load all images from mirrors to make their requests without cache and also avoid the navigator parallel host requests limit (5 aproximatelly) and make your page load faster.
protected/extensionsSee the following code example:
In config/main.php (or your configuration file):
... 'components'=>array(... 'parallelize'=>array( 'class'=>'application.extensions.parallelizeurl.ParallelizeUrl', 'hosts'=>array( 'http://m01.artfos.com.ar', 'http://m02.dev.artfos.com.ar', 'http://m03.dev.artfos.com.ar', ) ) ...
To use it just do the following anywhere in you app:
$imgsrc = yii::app()->parallelized->getParallelizedHost() . yii::app()->baseUrl . '/images/img0020.jpg';
and it will get a random host for you.
Total 2 comments
Hi,
I tried to use this extension and got error like
Is there away not to make the hostname random, but sequential instead? I believe you can make use of static variables like CWidget does to generate the widget ID when not given.
Leave a comment
Please login to leave your comment.