问题
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