开发者

Handle HTTP-Headers and status codes in controller

开发者 https://www.devze.com 2023-03-04 18:14 出处:网络
Im currently polling data with from an Database with an regular interval. For the backend I\'m using C# and MVC2 as framework. As I\'m fetching data with an interval of 10 seconds now I would like to

Im currently polling data with from an Database with an regular interval. For the backend I'm using C# and MVC2 as framework. As I'm fetching data with an interval of 10 seconds now I would like to in the backend in my controller implement some kind of conditional that will parse the http head开发者_运维问答er and not fetch the data again if it has not been modified since last fetch. I'm not really sure how I would go about with this. Anyone have any good suggestions?!

Regards


Why mess around with http headers for this? Just use the OutputCache attribute - this is exactly what it's for.

0

精彩评论

暂无评论...
验证码 换一张
取 消