I needed custom event grouping by category within a Solspace Calendar table. The only way I could find to do this was the following:
Use {exp:stash:append_list} within {exp:calendar:cal} to store the events by category and day.
{exp:stash:append_list name="cal-day-events-{date format="%m"}-{date format="%j"}-{categories show_group="7" limit="1"}{category_id}{/categories}"}
Then use EE's native {exp:channel:calendar} in an embedded template with {exp:stash:get_list} to retrieve the events.
Good news is, it worked!
Since the page is so query intensive I'd like to do some caching to improve the speed of page load.
I tried use EE's native template caching to cache the entire template. It worked on the first load, but subsequent page loads showed no events. It seems that the stash + embedded template approach doesn't work with template caching. Turning it off fixed the issue.
What is a better way to cache this data? Suggestions?