Yii 1.1: parallelizeurl

ParallelizeUrl for multiple host files manipulation
5 followers

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.

Resources

Documentation

Requirements

  • Yii 1.0 or above

Installation

  • Extract the release file under protected/extensions

Usage

See 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.

Change Log

June 13, 2009

  • Initial release.

Total 2 comments

#6283 report it
khaperey at 2011/12/24 02:22pm
error

Hi,

I tried to use this extension and got error like

Property "CWebApplication.parallelized" is not defined
#3225 report it
Asgaroth at 2011/03/27 10:13am
sequential

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 to leave your comment.

Create extension
  • Yii Version: 1.1
  • License: New BSD License
  • Developed by: sebas
  • Category: Networking
  • Votes: +3
  • Downloaded: 515 times
  • Created on: Jun 13, 2009
  • Last updated: Jun 13, 2009