Manual:$wgAdaptiveMessageCache

Details
Instead of caching everything, keep track which messages are requested and load only most used messages.

This only makes sense if there is lots of interface messages customised in the wiki (like hundreds in many languages).