Add template cache

Add template caching in production.

Needs to be tested and validated before merging.