We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45063
    • 40 Posts
    I have three separate domains. Each one is pointing to one single-context MODx installation. The difference between domains is conditional and based on If extra snippet that checks the site_url changes. Because of this, page load time is extremely slow. About 3 seconds. I discovered really nice Supercache extension, that increases page load in couple times. But problem is, when I visit first domain it caches and on second domain I am seeing content from the first one. Can I somehow clear the cache when site_url is changing?

    I was trying to make $modx->cacheManager->refresh(); according to server HTTP_HOST, but no luck. It refreshes cache every single time domain is shown. E.g on every page visit on exact domain, so performance stays the same bad.
      • 45063
      • 40 Posts
      The problem was solved by using Domaineer plugin by Mark-H. Instructions is here: https://github.com/Mark-H/Domaineer. Just array of domain-based options and that's all! No modifiers was used. Performance is great, by the way. Its a bit tricky sometimes. For example, when you need to hide specific resource in menu from specific domain. I just created +hideMenuItem option with "&excludeDocs=`55`" value and placed [[!+hideMenuItem]] in wayfinder call.

      Tip: Documentation says that plugin must run on WebPageInit event, but I noticed a little performance boost by setting it to OnHandleRequest.