Hy,
I have a sitecache.idx.php that is 6Mb.
It causes memory issues (+-150 permanent visitors)on my server.
Is there any way to split or reduce the memory for the sitecache?
-
☆ A M B ☆
- 24,524 Posts
How many resources do you have? You can cut it down somewhat by using a single small snippet
and use this snippet to include files containing the template and chunks, as well as other snippets:
[[loadfile? &file=`assets/templates/mytemplate/template1.php`]]
This way there is only one snippet in the cache file instead of all of your templates, chunks and snippets.
However, several thousand resources will choke the cache file in any case, as each resource has an entry in three different arrays in the cache.
-
MODX Staff
- 730 Posts
There’s no easy way to handle this, emetik. Evolution is designed to work with that alias/path data cached in that manner. It’s possible of course to modify how the caching and the resource aliases and paths work in the core, if you know enough about the core to hack it to your specific needs. This isn’t highly recommended as it breaks your upgrade path etc.
There is also a very preliminary (experimental) branch of Evolution underway to explore a different technique for storing/retreiving this information (a closure table). It’s not even alpha yet, i.e. it’s not complete enough to give it a try.
My recommendation here would be to port the site to Revolution. It was designed with a more flexible and partitioned caching system. Recent optimizations in the caching have decreased the size of the context cache files (Revo’s equivalent to the Evo sitecache, basically) significantly. We figure this size reduction is probably on the order of 60%. If you play with the cache_format, you can get the size down even more. Lastly, perhaps you can partition sections of your site’s Resources into different Contexts, spreading the caching load between them.
I also thougt revo could be a part of the answer.
The only thing that scared me is perfoming the upgrade beacause table structures aren’t the same and I didn’t find any script that does it even just a part of it (content, tv, snippets,...)
-
☆ A M B ☆
- 24,524 Posts
Do all of those resources need to be dynamic resources? If they are, for example, archived posts of some kind, you could move the content to a custom table or files and load them on demand with a snippet.