Mod-PageSpeed support for multiple domains on WordPress


We are hosting hundreds of websites on multiple hosts in AWS, and are trying to correctly configure the Apache Mod-PageSpeed. The issue we have is the following: since the list of hosted websites is dynamic, whitelisting them one by one in the configuration using ModPagespeedDomain isn’t a solution.

So in our test, for now, we are using ModPagespeedDomain *. As a result, other domains are obviously failing, since the websites end up having resources like, where does exist, but the target website doesn’t have mod-pagespeed.

I have the following two ideas, but didn’t manage to make neither work:

  • Rewrite all resources to the main domain. I have tried ModPagespeedMapRewriteDomain, ModPagespeedMapProxyDomain and ModPagespeedMapOriginDomain but I didn’t manage to make it work properly (outside domains are still fetched from their origin). Ideally, following the previous example, is fetched, optimized, and served from our servers directly.
  • Only work on the requested domain, if that’s possible, but I didn’t find out how. So if is requested, all resources in the page pointing to would be optimized and not others, and if it’s, then only the ones to
  • The last resort is to block all outside domains, which isn’t ideal either to be able to easily add new dependencies.

Open for any idea / suggestion. Thank you! Charles

Charles PM 4 months 0 Answers 14 views 0

Leave an answer