none
Using Windows::Web:Http::HTTPClient API OnlyFromCache option.

    Question

  • Dear Forum members,

    I am trying to use the newly announced Windows::Web:Http::HTTPClient API with cache support from the platform.

    I would like to know the following.

    1. Where is the cache stored - i.e. folder / location on disk?

    2. If the PC is rebooted or application is restarted or application crashes, what happens to the cache?

    3. How does the system keep the cache up-to-date even when the app is not running?

    Friday, December 06, 2013 7:16 AM

Answers

  • To clarify Matt's answer:

    1. The totally reserve the right to move that cache around, and change our cache policies.  I know for a fact that over the years, that cache has changed dramatically.  So really, don't ever rely on the cache specifics.

    2. As of today, I've noticed that my app caches tend to persist.  (Hint: this is maintained by the same code that IE's cache uses; so today it has a lot of the same properties)

    3. It's not refreshed automatically BUT you can request a refresh in several different ways:

    3a) Redownload the data!

    3b) Use the Content Prefetcher to keep the cache up to date even when your app isn't running

    It's important to note that the cache really is a cache: the system decides, on every request, whether the data is appropriate or not -- the system might decide that the data is out of date, or needs to be deleted to make room for new data.  Or, the data might not be cached in the first place (which depends on the headers that the content had when it arrived on the system).  You always need a strategy for handling missing content.


    Network Developer Experience Team (Microsoft)

    • Marked as answer by basanjeev Monday, December 09, 2013 2:19 AM
    Friday, December 06, 2013 10:34 PM

All replies

  • 1) You find out by using Process Monitor.  Hint:  it's in the application folder.

    2) It's simple to find out by crashing the app/rebooting.

    3) If it's not running, the cache doesn't change...


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, December 06, 2013 2:13 PM
  • To clarify Matt's answer:

    1. The totally reserve the right to move that cache around, and change our cache policies.  I know for a fact that over the years, that cache has changed dramatically.  So really, don't ever rely on the cache specifics.

    2. As of today, I've noticed that my app caches tend to persist.  (Hint: this is maintained by the same code that IE's cache uses; so today it has a lot of the same properties)

    3. It's not refreshed automatically BUT you can request a refresh in several different ways:

    3a) Redownload the data!

    3b) Use the Content Prefetcher to keep the cache up to date even when your app isn't running

    It's important to note that the cache really is a cache: the system decides, on every request, whether the data is appropriate or not -- the system might decide that the data is out of date, or needs to be deleted to make room for new data.  Or, the data might not be cached in the first place (which depends on the headers that the content had when it arrived on the system).  You always need a strategy for handling missing content.


    Network Developer Experience Team (Microsoft)

    • Marked as answer by basanjeev Monday, December 09, 2013 2:19 AM
    Friday, December 06, 2013 10:34 PM
  • To clarify Matt's answer:

    1. The totally reserve the right to move that cache around, and change our cache policies.  I know for a fact that over the years, that cache has changed dramatically.  So really, don't ever rely on the cache specifics.

    Hi, first of all, sorry for necroing this thread...

    I've been testing HttpClient's cache and it works great, it caches response and it uses it later if it receives 304 from server.

    Problem is using that cached response(file) when offline. Is there any way to get path of the cached file programatically? Thx.

     


    • Edited by HillBilly84 Thursday, July 03, 2014 9:41 PM
    Thursday, July 03, 2014 9:39 PM