Apache includes the ability to function as a reverse proxy, which means it can be directed to delegate certain requests to another server. I've found two useful applications for mod_proxy recently: mirroring static files from production, and accessing JSON data.
If your files
directory is large, it may be impractical to replicate it on a development server. Instead, you can ask Apache to proxy requests for any missing files to the production server.
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} /sites/default/files RewriteRule ^(.*)$ http://www.example.com/$1 [P,L]
The "P" flag after a RewriteRule
creates a proxy, and "L" indicates that processing should stop after this rule. Note this will prevent ImageCache from generating new derivatives on the development site.
One of the great things about JSON encoding is the data can easily be consumed directly in a browser. You don't need glue code in your application, or (horrors) an SDK. You do however need to deal with the browser's same-origin policy.
On the FontFuse project, we solved this by creating a simple proxy:
RewriteRule (.*serviceapi/webink/.*) http://www.extensis.com/$1 [P,L]
In production, we're using Varnish to allow caching of common requests, but this simple proxy enables development copies of the site to run without additional services.