Hi,
We have a quite big site running MODX (10.000 resources). We are using the modx->makeUrl function to generate internal links across the site, but it seems that this is taking up a lot resources to connect to the db to get the resources' alias. We have disabled the cache_alias_map setting to prevent the resource cache becoming too big.
Our idea to improve it was to create a small overlaying method to save the url in cache with the id as reference for easy retrieving next time, and then call this method instead of modx->makeUrl.
Would that be a good idea or do you have experience in improving this any other way?
-
☆ A M B ☆
- 70 Posts
-
MODX Staff
- 10,725 Posts
Perhaps there is some confusion. It won't hit the db if you do not disable cache_alias_map. If you do disable that, you are forcing it to hit the db rather than create a cache of all the URI's in your site. It's a trade-off. In either case, this overhead should only occur on first generation of the pages. Once they are cached, there is no longer an issue.