因为做网站的静态页缓存,所以做了这个测试
1、 MVC项目
准备了4个Action,分两组,一组是读取本地磁盘的一个html页面文件,一组是延时2秒
public class TestController : Controller{ public ActionResult Article(string name) { string path = @"I:\c#\nn.html"; using (StreamReader reader = new StreamReader(path)) { return Content(reader.ReadToEnd()); } } public async Task<ActionResult> Article2(string name) { string path = @"I:\c#\nn.html"; using (StreamReader reader = new StreamReader(path)) &nb