Hello,
I'd like to have haproxy caching/redirect the /static/.+ url path of my django instances to speed up static file serving. What's the best way to do that?
Hello,
I'd like to have haproxy caching/redirect the /static/.+ url path of my django instances to speed up static file serving. What's the best way to do that?
As far as I know, HAProxy doesn't do caching. For that you want something like Squid.
As far as treating /static/ seperately, you can set up your HAProxy config to redirect any URLs matching a pattern to another backend cluster:
frontend my_website *:80
mode http
acl static url_beg /static/
use_backend my_static_proxy if static
default_backend my_django_server