astartsky/url-balancer

There is no license information available for the latest version (1.1.3) of this package.

1.1.3 2016-02-28 13:03 UTC

This package is auto-updated.

Last update: 2024-10-28 01:16:55 UTC


README

Url balancer is a lightweight library for domain dynamic allocation.

  • Silex support
  • Extendable strategies
  • Extendable optional caching

Usage


$urlBalancer = new \Astartsky\UrlBalancer\UrlBalancer();
$urlBalancer->setStrategy(new \Astartsky\UrlBalancer\Strategy\HashStrategy());
$urlBalancer->addBucket(new \Astartsky\UrlBalancer\Domain("static1.myawesomesite.com"));
$urlBalancer->addBucket(new \Astartsky\UrlBalancer\Domain("static2.myawesomesite.com"));
$urlBalancer->addBucket(new \Astartsky\UrlBalancer\Domain("static3.myawesomesite.com"));

$url = $urlBalancer->getUrl("/images/my_impressive_content.png");

License

MIT