I am caching a collection of activerecord rows (subsonic). When I look at the cache with ANTS Memory Profiler, I can see that some related tables to the activerecord I would like to cache are cached as well. This makes the cached items very large, because of the additionally (not needed) cached tables.
Any ideas on how to prevent this?
I believe you will have to modify or remove the lazy-loading of relationships in the Active Record classes.
The lazy-loading behavior is generated by the ActiveRecord.tt template, starting at line 300 in the most current version:
I would try removing this entire region and seeing if the excessive caching is resolved. Of course, if you rely on the lazy-loading behavior you will have to address that now.