To enable a parser cache, a memcached installation is the ideal choice.
https://www.mediawiki.org/wiki/Manual:$wgParserCacheType
Check notes from https://www.digitalocean.com/community/tutorials/how-to-secure-memcached-by-reducing-exposure for the configuration localhost only.