Added ability to cache templates.