Handle HTTP-Headers and status codes in controller

橙三吉。 提交于 2020-01-15 11:36:13

问题


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 header 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


回答1:


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



来源:https://stackoverflow.com/questions/5933888/handle-http-headers-and-status-codes-in-controller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!