Entity view (Content)

One Useful Module For Your Local Drupal Development

By stran
Jul. 2, 2014

Stage File Proxy is one of my favourite modules that I always enable during a local Drupal development. When developing locally, I'll often be looking at a miserable, unattractive site with broken links and images. Stage File Proxy allows me to sync the production database without having to sync the production files, which could be several gigabytes.

Stage File Proxy works by only downloading the files from the production site as they are needed on my local environment. This saves both time and hard drive space when dealing with a large production site (such as the project we worked on for Intel). If you really want to save disk space, there is an option that allows you to hotlink directly to the production site, rather than downloading the files to your local.

Setting up Stage File Proxy is extremely easy. After the module has been enabled, simply add the following to your settings.php

$conf['stage_file_proxy_origin'] = 'http://example.com'; // no trailing slash

If the site is using HTTP Basic Authentication (the browser popup for username and password) you can embed those in the url. Be sure to URL encode any special characters:

$conf['stage_file_proxy_origin'] = 'http://myusername:letme%26in@example.com';

If you want to hotlink the files rather than downloading them:

$conf['stage_file_proxy_hotlink'] = TRUE;
Post Tags: