TemplatesCache is made threadsafe.