Many thanks #41
CalinBunea
started this conversation in
General
Replies: 2 comments
-
Thats exactly what I did for my product website. However I still use AspNetCore.Mvc as a router and request handler (works fast), but I use my RazorEngine as a templating tool. I cache all data in lightweight text format so page rendering wont hit database and it comes to read data file and pass data into compiled and cached template. Im happy to know RazorEngineCore is helpful to you. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I use Tilda-like approach in my system to build every page out of blocks that goes one by one |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I want to re-implement our website portal at the company where I work. The website has to be fast (server and client side), UI can be slightly different depending on our partnerships. So basically I need to split UI in multiple flexible components but to also keep the CSS,JS,HTML footprint as low as possible and of course bundle them together.
So I thought like this: what is a website portal after all? You have some "backend" logic which would gather the data from whatever microservices or repositories, and then you need to basically template that data and create a HTML + JS + CSS which you use to respond to a client browser request. Since the repositories behind the data needed for our HTML are quite slow, I decided to take it to the next level and pre generate all our ~1 million HTML pages. One stupid way to do it would be to make HTTP requests to your own hosted portal, but that is very slow and why not do it smart?
I've decided to go for Razor .cshtml for templating, but without ASP.NET MVC engine. I will basically have my own "RequestContext" which will contain all the informations I would need, and probably all the data models, then I will simply run it through the Razor templating engine to obtain the HTML. Since I can render template in template I also achieve the component base splitting and granularity, decoupling the components.
Then, when I publish my portal, I can minify the .cshtml, bundle JS, bundle CSS and so on.
The out of the box Razor engine which comes with ASP.NET MVC is too coupled with MVC and ASP.NET engine and it can't be really used outside of website environment (or at least is not straight forward)...
What you did with this project is extremely helpful and I want to express my gratitude for the work you've done.
Thank you so much!
Beta Was this translation helpful? Give feedback.
All reactions