#1905544: Cache mailsystem_get_classes() between requests

That issue did a good job of fixing the caching issue but in reality calls in hook_init are very very performance heavy and so as a result we should look into alternatives,

Like generating the mail_system classes elsewhere, i.e. the first time the module is installed and never again until cache is cleared.

Comments

kylebrowning created an issue. See original summary.

david_garcia’s picture

Issue summary: View changes
heddn’s picture

It is a bit abusive, but not too much so. Implement hook_flush_caches and and don't return any value. That will get called on every cache flush. With the added benefit that during module install, it will also get called.