Example usage for org.apache.http.impl.client.cache CacheConfig setHeuristicDefaultLifetime

List of usage examples for org.apache.http.impl.client.cache CacheConfig setHeuristicDefaultLifetime

Introduction

In this page you can find the example usage for org.apache.http.impl.client.cache CacheConfig setHeuristicDefaultLifetime.

Prototype

public void setHeuristicDefaultLifetime(long heuristicDefaultLifetimeSecs) 

Source Link

Document

Sets default lifetime in seconds to be used if heuristic freshness calculation is not possible.

Usage

From source file:fr.ippon.wip.http.hc.HttpClientResourceManager.java

private CacheConfig createAndConfigureCache() {
    CacheConfig cacheConfig = new CacheConfig();
    cacheConfig.setSharedCache(false);/*from   w ww  .  j  ava  2  s  .com*/
    cacheConfig.setHeuristicCachingEnabled(true);
    cacheConfig.setHeuristicCoefficient((float) heuristicCacheRatio);
    cacheConfig.setHeuristicDefaultLifetime(60);
    cacheConfig.setMaxObjectSize(4000000);

    return cacheConfig;
}