How to remove cache compile template when run CompileRenderAsync
See original GitHub issueI can’t remove cache template after run method CompileRenderAsync
My case is:
Step 1: run resultHtml = await _razorLightEngine.CompileRenderAsync(templateId, htmlTemplate, obj);
When I change htmlTemplate
to new value template and run this method again (Step 2), but this still return value that ran in Step 1
htmlTemplate
is string template
So, how can I remove cache to get the new value follow htmlTemplate
Thank you.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:16
Top Results From Across the Web
RazorEngine un-cache compiled templates
EDIT: I have just read a bit about how the caching works and that if the same name is passed in with a...
Read more >Clear template cache from the CLI?
I was looking for a way to clear the “template caches” and “compiled templates” from the CLI, as I want to automatically do...
Read more >RazorLight
Use Razor to build templates from Files / EmbeddedResources / Strings / Database or your custom source outside of ASP.NET MVC. No redundant...
Read more >Old copy of template is running - how do I clear the cache?
How do I clear the cache or force a rebuild of the cache?> the cache key used for storing the compiled template is...
Read more >Using Razor Templates without MVC (RazorLight)
// First create engine. var engine = new RazorLight.RazorLightEngineBuilder() . ; // Try to find template. var found = engine.TemplateCache.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What do you mean by “turning on compiled template caching”? I would also be interested in that. I think UseMemoryCachingProvider() or UseCachingProvider() extensions only affect page template cache, not RL’s private compiled metadata template cache which is the crux of the problem.
Is there any update related to invalidating or overwriting a cached template? This doesn’t work.