Hey, it’s me again and I have few questions/suggestions and I would like to hear your opinion about it.
When you are talking about cache file and its size, you have most probably file siteCache.idx on your mind. So I guess my goal is to reduce the size of this file as much as possible.
My first idea is to disable SEO urls and delete all aliases from the database. I know, it’s not very SEO-frienldy, but it is better to have working SEO-hostile web than nothing

The document titles are on this particular web pretty long so this move would save approximately about 10-15% of space. Good thing is that it would also rapidly slow down the speed of growing of the cache file.
The second idea is related to snippets. The snippet cache is also included in this file and currently takes about 30% of the size (guessing from the scrollbar). The problem is that almost every snippet includes a lot of redundant lines - comments. Sometimes there are more comments than normal php lines

So if I removed comments before saving to the cache I would also spare a lot of space.
The third idea is to move some content of this file to other files. Unfortunately I don’t know much about how MODx and generally php work from the inside, and what is really behind this limit of 5000 documents. But in the case that the slowdown was caused by long time of parsing such a big file, moving few parts of the cache file into other files could help. For instance I could store snippets separately, each in its own file in some subfolder, and load them to the script later or when possible, only when needed.
I hope I don’t bother you much with my long messages, I would appreciate any tips or experience with this problem.