At the moment, every template rendering causes a request to the CMS Wiki, which will create performance problems when going live.
This is because the Twig_Loader_Chain expects an exception when a loader is asked for the cache key of a template which doesn't exist. At the moment this is "solved" by trying to load the page from the wiki in WMDE\Fundraising\Frontend\Presentation\Content\TwigPageLoader::getCacheKey which causes the request. We can't just simply remove the request because the the TwigPageLoader would simply grab all templates form the wiki and our file-based templates would be ignored.
So caching has to be introduced somewhere in the TwigPageLoader -> WikiContentProvider -> PageRetriever classes:
- When adding the cache to TwigPageLoader, getCacheKey and isFresh must interact with the cache class, throwing the exception if necessary.
- When adding the cache class to WikiContentProvider or PageRetriever, TwigPageLoader does not need to be modified, it will throw the exception if the content is empty.