ASP.NET MVC : how do I return 304 “Not Modified” status?

后端 未结 3 1469
無奈伤痛
無奈伤痛 2020-12-16 12:09

ASP.NET MVC 3.0, IIS 7, .NET 4

I have an action that returns data that seldom changes (almost static).

Is there an easy way to:

  1. return 304 \"
3条回答
  •  一生所求
    2020-12-16 12:46

    (Very!) late answer but this question pops up near the top in search engine results so it might be useful to future people landing here.

    Alternative for part 1:

    return new HttpStatusCodeResult(304, "Not Modified");
    

提交回复
热议问题