Adding templates to the cache.