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

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

Introduction

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

Prototype

public void setHeuristicCoefficient(float heuristicCoefficient) 

Source Link

Document

Sets coefficient to be used in heuristic freshness caching.

Usage

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

private CacheConfig createAndConfigureCache() {
    CacheConfig cacheConfig = new CacheConfig();
    cacheConfig.setSharedCache(false);// w w  w  .  j  av a 2  s . co  m
    cacheConfig.setHeuristicCachingEnabled(true);
    cacheConfig.setHeuristicCoefficient((float) heuristicCacheRatio);
    cacheConfig.setHeuristicDefaultLifetime(60);
    cacheConfig.setMaxObjectSize(4000000);

    return cacheConfig;
}