Optimizing page load speed practices include to load static assets, like images, css, js, from subdomains, so to increase performance, by using cookieless domains, but most importantly by having parallel downloads from the browser.
I use varnish reverse cache in front of my webserver which serves various websites.
How I can instruct varnish to rewrite url for static files (css,js,png,jpg,jpeg,gif), so they are served by a subdomain? So if someone asks for domain.com/image.png this to be finally served from static.domain.com/image.png. Domain and subdomain are served from the same server. Varnish already connect to the backend at 127.0.0.1
Is it more efficient to do the url rewriting at varnish or at the backend (apache)? I think it would be faster to be done in varnish, since it's at the frontline, right?
What is the way to do the same in apache?