I\'ve read that in order to disable caching while using get and post methods in HttpClient, I need to use a WebRequestHandler as my HttpClien
If using Windows.Web.Http.HttpClient, the clean way to fix this issue from the client side is:
var httpFilter = new Windows.Web.Http.Filters.HttpBaseProtocolFilter();
httpFilter.CacheControl.ReadBehavior =
Windows.Web.Http.Filters.HttpCacheReadBehavior.MostRecent;
var httpClient = new Windows.Web.Http.HttpClient(httpFilter);
This way, you avoid filling the app's cache with temp files when using random query strings. Each response is stored in the cache.
Of course, it is always recommended to fix the issue from the server side. Add the following header, and you won't need to worry about cache on each client:
Cache-Control: no-cache
Full response:
HTTP/1.1 200 OK
Content-Length: 31
Content-Type: text/plain; charset=UTF-8
Cache-Control: no-cache
...