@ Override public void init ( FilterConfig filterConfig ) throws ServletException { super . init ( filterConfig ) ; int reloadTime = readInt ( filterConfig . getInitParameter ( INIT_PARAM_RELOAD_TIME ) , 0 ) ; this . resetTime = readInt ( filterConfig . getInitParameter ( INIT_PARAM_RESET_TIME ) , resetTime ) ; this . cacheKeyFormat = readString ( filterConfig . getInitParameter ( INIT_PARAM_CAHE_KEY_FORMAT ) , DEFAULT_CACHE_KEY_FORMAT ) ; lastResetTime = new Date ( ) . getTime ( ) ; CacheConfig < String , CachedResponse > cacheConfig = new CacheConfig <> ( ) ; String providerValue = readString ( filterConfig . getInitParameter ( INIT_PARAM_CACHE_PROVIDER ) , null ) ; if ( providerValue != null ) cacheConfig . setProvider ( CacheConfig . CacheProvider . valueOf ( providerValue . toUpperCase ( ) ) ) ; String cacheHost = filterConfig . getInitParameter ( INIT_PARAM_CACHE_HOST ) ; cacheConfig . setHostname ( cacheHost ) ; int cachePort = readInt ( filterConfig . getInitParameter ( INIT_PARAM_CACHE_PORT ) , 0 ) ; cacheConfig . setPortNumber ( cachePort ) ; if ( ! CacheFactory . isCacheProvider ( cache , cacheConfig . getProvider ( ) ) ) { try { cache = CacheFactory . getCache ( cacheConfig ) ; } catch ( Exception ex ) { LOGGER . debug ( "Failed to initialize Cache Config: {}. Falling back to default Cache Service." , cacheConfig ) ; cache = CacheFactory . < String , CachedResponse > getDefaultCache ( ) ; } } LOGGER . debug ( "Cache Filter initialized with: " + "{}:{},\n" + "{}:{},\n" + "{}:{},\n" + "{}:{},\n" + "{}:{}" , INIT_PARAM_CACHE_PROVIDER , providerValue , INIT_PARAM_CACHE_HOST , cacheHost , INIT_PARAM_CACHE_PORT , String . valueOf ( cachePort ) , INIT_PARAM_RELOAD_TIME , String . valueOf ( reloadTime ) , INIT_PARAM_RESET_TIME , String . valueOf ( resetTime ) ) ; }
eg . queryString header = X - Requested - By parameter = username . URI is always part of key