Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine if an HttpResponseMessage was fulfilled from cache using HttpClient

What is the equivalent to WebResponse.IsFromCache when using HttpClient and HttpResponseMessage?

Is there some HTTP header in the response that I can look at?

like image 598
Andrew Arnott Avatar asked Dec 31 '12 15:12

Andrew Arnott


1 Answers

FYI: The Windows.Web.Http HttpClient (a similar API targetted at Windows 8.1 app development) does include an HttpResponseMessage.Source field that specifies where the result came from (common values are "cache" and "network").

The Windows.Web.Http classes are usable from C# and other .NET languages, from C++, and from JavaScript (when running as a WwaHost app like from the Windows app store).

like image 147
Peter Smith Avatar answered Oct 21 '22 17:10

Peter Smith