我刚刚阅读了此有趣的帖子在Patrick Steel-Idem编写的性能日历上.帖子基本上描述了一种将html片段刷新到浏览器的方法,以缩短感知的加载时间.它显示出,通过向浏览器发送html的小片段,它可以开始进行详细说明,并可以更早地提出请求.Patrick在他的示例中使用nodejs,并使用Marko作为模板引擎.
I just read this interesting post on perf calendar written by Patrick Steel-Idem. The post basically describes a way of flushing html fragments to browser, in order to improve the perceived loading time; it shows, as by sending the browser little fragments of the html, it can start its elaboration, and further requests earlier. In his example Patrick works with nodejs, and uses Marko as templating engine.
我的问题是:由于我拥有完全不同的堆栈(asp mvc5),您知道一种使用Razor作为模板引擎来实现相同结果的方法吗?你能指出我正确的资源吗?
My question is: since I have a completely different stack (asp mvc5) do you know a way to achieve the same results using Razor as templating engine? Can you point me to the right resources?
谢谢
推荐答案正如Jason Evans和Andy Nichols指出的那样,Razor并没有内置任何东西来支持这一点,但是有一些解决方法.
As Jason Evans and Andy Nichols point out there is isn't anything built into Razor to support this but there are workarounds.
但是,MVC 6具有新的关键字 FlushAsync()可以满足此要求.
However MVC 6 has a new keyword FlushAsync() to address this requirement.
@await FlushAsync()
更多推荐
Razor是否支持html片段刷新?
发布评论