I have an event that retrieves information from Publication Metadata. I would like to cache this information so that I don't need to access the Publication object each time. I see that the ContextVariables allow me to pass information between events. Can I use this for caching? If not, any alternative ways to cache information to re-use?
I tend to use a static Dictionary in a config class. I think (at least in 2013+ versions) that this should persist for the lifetime of the parent CMS process (typically core service, but could be publisher etc.). Context variables are probably only persisting for the execution of a (chain of) event(s), so will be wiped between separate actions that trigger new events