Reply to comment

With Caching

The C# .NET client implementing caching: http://cookbook.daylife.com/sites/default/files/DayLifeAPI_DotNet_with_caching.zip

 

    // DayRequest uses a threadsafe internal cache. What this means is that the response for each API request is cached on
    // the first request and returned from cache the second time around. the benefits are:
    // 1) Wastefull api calls are not made for the same request again and again
    // 2) response from cache is heaps faster

    // Note the internal cache behaviour is defined by three constants in DayLifeAPI.DayRequest Class:
    // 1) CacheRequestsForMinutes
        /// Items expire from the cache after the number of minutes specified in MaxItemsInCache
        /// Set this depending on the minimum freshness you want for your data.

    // 2) MaxItemsInCache
        /// The cache will hold a maximum number of items as specified by MaxItemsInCache
        /// The more items you have in cache the greater the memory footprint.
        /// If you are likely to make 100 unique requests many times during the time in CacheRequestsForMinutes above
        /// then set this to 100

    // 3) PruneCacheEveryNumRequests
        /// The cache will be pruned (expired and excess items removed) every X number of requests
        /// Where X is PruneCacheEveryNumRequests.
        /// If you make say 100 requests in 10 minutes then set this to 100

    // To be adjusted these to FIT the applications usage patterns.

 

 

 

Reply

CAPTCHA
This question helps us test whether you are a human visitor and to prevent automated spam submissions.
12 + 5 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.