CacheConfig cacheConfig = new CacheConfig(); cacheConfig.setMaxCacheEntries(1000); cacheConfig.setHeuristicCachingEnabled(true); cacheConfig.setHeuristicDefaultLifetime( settings.getCacheExpiration());
public void reload() { final DefaultHttpClient httpClient = new DefaultHttpClient(connectionManager); if (properties.getBoolean(OutagesProperties.ENABLE_CACHE)) { final CacheConfig config = new CacheConfig(); config.setHeuristicCachingEnabled(true); config.setHeuristicDefaultLifetime(properties.getLong(OutagesProperties.CACHE_TTL)); config.setHeuristicCoefficient(1); config.setMaxCacheEntries(properties.getInt(OutagesProperties.MAX_CACHE_ENTRIES)); config.setMaxObjectSize(properties.getLong(OutagesProperties.MAX_OBJECT_SIZE)); this.client = new CachingHttpClient(httpClient, config); } else { this.client = httpClient; } }
public void reload() { final DefaultHttpClient httpClient = new DefaultHttpClient(connectionManager); if (properties.getBoolean(CseProperties.ENABLE_CACHE)) { final CacheConfig config = new CacheConfig(); config.setHeuristicCachingEnabled(true); config.setHeuristicDefaultLifetime(properties.getLong(CseProperties.CACHE_TTL)); config.setHeuristicCoefficient(1); config.setMaxCacheEntries(properties.getInt(CseProperties.MAX_CACHE_ENTRIES)); config.setMaxObjectSize(properties.getLong(CseProperties.MAX_OBJECT_SIZE)); this.client = new CachingHttpClient(httpClient, config); } else { this.client = httpClient; } }
public void reload() { final DefaultHttpClient httpClient = new DefaultHttpClient(connectionManager); if (properties.getBoolean(HotIssuesProperties.ENABLE_CACHE)) { final CacheConfig config = new CacheConfig(); config.setHeuristicCachingEnabled(true); config.setHeuristicDefaultLifetime(properties.getLong(HotIssuesProperties.CACHE_TTL)); config.setHeuristicCoefficient(1); config.setMaxCacheEntries(properties.getInt(HotIssuesProperties.MAX_CACHE_ENTRIES)); config.setMaxObjectSize(properties.getLong(HotIssuesProperties.MAX_OBJECT_SIZE)); this.client = new CachingHttpClient(httpClient, config); } else { this.client = httpClient; } }