Currently, I am using RazorEngine v2.1 as part of a background process that sends templated emails (thousands of them). To speed things up, the templates are compiled with their
It seems that RazorEngine stores cache for compiled templates inside TemplateService instance. So you can recreate new instances of TemplateService from time to time to drop all cached templates.
You can also consider using my own library which is based on RazorEngine and implements custom caching mechanism with expiration: http://www.nuget.org/packages/Essential.Templating.Razor