These are chat archives for Antaris/RazorEngine

13th
May 2015
Brett Baggott
@BrettBaggott
May 13 2015 18:23
I posted about this on the Google Group but thought I should post it here as well. So if I understand correctly, the now obsolete Parse is, potentially, creating an assembly per request (since there is no accomodation for caching, etc.)
Matthias Dittrich
@matthid
May 13 2015 19:28
You shouldn't use obsolete API if you don't need to. To answer your question: It depends on the overload and version you are using..
Brett Baggott
@BrettBaggott
May 13 2015 21:33
Version 3.4.1 and called like so: var html = Razor.Parse(page.Content.Value);
where page.Content.Value is a snippet of Razor syntax pulled from data
I understand we shouldn't use obsolete API, this is adopted code and I want to follow the process outlined in your Upgrading to 3.5.0, but I'm being told "what we have now is good enough, we might get to that later". Problem is, this is yet to be deployed to production code. It will be replacing a website that sees about 2 million pageviews per month, and the bulk of those we be delivered via that Parse call.
Brett Baggott
@BrettBaggott
May 13 2015 21:38
So if I'm reading everything right, that particular way of calling the API will generate an assembly per request (barring any other caching mechanisms such as output cache)
Matthias Dittrich
@matthid
May 13 2015 21:58
Yes you should at least use an overload with a name/cachename parameter to get some kind of caching...

It should actually be quite easy to see (even while debugging) if caching is in place. First its just very slow when everything is compiled, and second you can see a "csc.exe" in task manager whenever a template is compiled (which should be the one time only for every template)

Does this answer your question?