We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47551
    • 2 Posts
    Hi MODX developers!

    I'm Carlos Corrales, Bitnami developer, and I'm here to ask for some information. We have found something weird but it seems that it something you want to do. It is about saving the site URL in the cache.

    You have a variable called site_url that will take a value depending on the first IP/Domain from which it is accessed the first time. It means that if the user changes its domain/IP address, the application won't be accessible until he removes the cache.
    Is this correct? Is there a better way to remove the cache than just removing the folder core/cache?

    Thank you very much!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You could use ClientConfig, which allows you as the Admin user to create custom pseudo-settings, which will override the default System Settings. Then the user can change the value of the ClientConfig setting, and that value will be used as the site_url.

      https://www.markhamstra.com/modx/2012/12/clientconfig-putting-clients-in-control/

      However, it is to be presumed that he's not going to be changing that very often, so it might be wiser to clear the cache if and when he does. It's possible that the value may well pop up in other places that wouldn't be overridden by the ClientConfig value.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 18373 ☆ A M B ☆
        • 3,141 Posts
        Putting the site_url in ClientConfig isn't really going to help - that is cached too.

        If you have a site running on Bitnami that is moved to a different domain/IP, simply emptying the core/cache folder should be fine. It's also possible (and slightly better) to refresh the cache instead of just nuking it, by grabbing $modx and calling
        $modx->getCacheManager()->refresh();
        but I don't know how feasible that is with the Bitnami implementation.
          Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

          Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
          • 3749
          • 24,544 Posts
          If any tags that reference the site_url are uncached (e.g., in the base href tag), it might solve your problem:


          [[!++site_url]]
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 47551
            • 2 Posts
            Thank you very much guys!
            I will test it and let you know if any of these options work!