locked
Azure cache file name

    Question

  • Newbie question please? I am retrieving text file from Azure blog and it seems to cache forever. Can you tell me how to read the file EVERY time and NOT cache it. Thanks.

                    // get the book anchor name which will be used to get book file next
                    string anchorBookUri = "http://az722734.vo.msecnd.net/cdn/Office2013/EN/Data/Office2013.txt";
                    using (HttpClient client = new HttpClient())
                    using (HttpResponseMessage response = await client.GetAsync(anchorBookUri))
                    using (HttpContent content = response.Content)
                    {

                        anchorBookAsString = await content.ReadAsStringAsync();
                    }


    FS

    Wednesday, March 18, 2015 7:12 PM

Answers

  • Hi Frank14303,

    We can disable the HttpClient Cache by this:

    var filter = new HttpBaseProtocolFilter();
    
    filter.CacheControl.ReadBehavior = Windows.Web.Http.Filters.HttpCacheReadBehavior.MostRecent;
    
    filter.CacheControl.WriteBehavior = Windows.Web.Http.Filters.HttpCacheWriteBehavior.NoCache;
    
    HttpClient client = new HttpClient(filter)
    
    

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, March 19, 2015 4:19 AM
    Moderator