dotcloud/docker-registry — pull request #77 by rca (2013-09-15 22:18:05+00:00)
Title: Nginx X-Accel Support

I've been experimenting with speeding up image transfers. This patch uses nginx's X-Accel feature to offload file streaming to nginx. I've noticed ~25% speed increase with this feature using `wget`.

To use this, add the following to `config.yml`:

```
nginx_x_accel_redirect: /registry
```

And setup the `/registry` location in nginx to point to the root of the registry:

```
server {
[...]

location /registry/ {
internal;
alias /srv/registry/; # note the trailing slash
}

location / {
proxy_pass http://docker_registry;
}
}
```

Please let me know your thoughts and I can work on tests.

Also, this version puts the logic in `images.py`, but I think it's better suited in the `LocalStorage` class. Moving it there would require `Storage` classes to have some type of mechanism to modify headers; this can be done with an additional `get_headers()` call.

Thoughts?