Using Toran Proxy to speed up Drupal builds

Over the last couple of days an internal thread has been making the rounds at Acquia about speeding up Composer for Drupal builds. With Drupal 8, Lightning and the BLT project making heavy use of Composer to manage its dependencies, users frequently rebuilding from source, or those in remote regions with slow internet face a lot of dead time.

Within the discussion, someone mentioned Toran Proxy which acts as a mirror for Packagist, GitHub and other repositories that store code libraries. Because I live in Australia, the available bandwidth to external repositories is sometimes extremely slow; this lead me to try Toran out.

My home development server uses Fedora 19 (Schrödinger’s Cat) and it's a place I frequently try out scripts, applications and other tooling to both verify it does what it says, and keep a technical eye in as my career drifts ever further away. I was able to translate the download/configuration instructions into a Puppet manifest and have Toran deployed on my server in relatively short time however ran into issues with ensuring BLT (which uses downloaded packages from the right places.

In the end, the solution which worked for me was to patch one line in one file (src/Toran/ProxyBundle/Command/CronCommand.php) of Toran Proxy, whilst ensuring I continually ran Toran's inbuilt cron to generate the right resources for my local build to pull in. Prior to doing this I was running into dependency issues that lead me down seven or eight different garden paths. My definitive guide to getting Toran Proxy set up with BLT is as follows and presumes all initial instructions provided by the Toran Proxy team have been followed:

  • Apply the attached patch
  • Navigate to the /settings page and use the following image as a rough guide for configuring your instance

  • Run Toran cron by executing php bin/cron -v
  • Alter your BLT composer.json to use the following (changing the repo URL from to the domain your toran instance runs on and removing the secure-http parameter if your mirror uses HTTPS)
    "config": {
        "secure-http": false
    "repositories": {
        "0": {
            "type": "composer",
            "url": ""
        "1": {
            "type": "composer",
            "url": ""
        "2": {
            "packagist": false
  • Cross your fingers and run composer install
  • If any parts of the build fail, examine your app/toran/config.yml file and ensure that all the Drupal packages (except Coder) are tagged with and all non-Drupal packages are tagged with
  • Create a new entry in crontab to run the Toran cron as frequently as desired so packages are continually updated.

Your mileage may vary, but I was able to reduce a 40 minute build down to around 8 minutes as my laptop was sourcing libraries from a server 3 metres away rather than the other side of the World. The only slow downs for me were packages tagged with '*' or '-dev' as they bypass Toran and don't get added to my local cache.

Plain text icon toran-packagist-deprioritise.txt557 bytes


Many companies need to customize the packaging needs,
but in the packaging design experience is less,
you are one of them?
We are in the process of custom packaging production,often can not be sloppy,
because it represents the external image of the goods,
no sellers will buy the image of the poor external image,
like people do not like with a dressed People deal with the same.
So we must pay attention to the packaging design,
a direct decision on the future sales of the product trend.
<a href=>Packaging design</a>, including the surface of the printed pattern design and <a href=>packaging structure design</a> of these two factors,
and the two design words are more difficult,
if done these two aspects will greatly enhance the attractiveness of your product.

A lot of small and medium enterprises, has been looking for the best solution for enterprise products, want to customize the best packaging, but what is a good packaging? Good packaging should include two parts, one is the product packaging structure design, one is the product<a href=> packaging surface printing design</a>.
Product structure packaging is the main consideration is whether the customer to remove the packaging or whether it is unique enough, so that consumers never forget.
Followed by our product packaging surface printing vivid image, can be a good combination of product features to promote, to the consumer a great visual impact.
We can provide you with a variety of product packaging solutions, and free for your design product packaging. If you want to know more, you can visit our official website: <urlhttp>//]

Add new comment