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!
-
☆ 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.
-
☆ 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.
If any tags that reference the site_url are uncached (e.g., in the base href tag), it might solve your problem:
Thank you very much guys!
I will test it and let you know if any of these options work!