if (getExpireCache(0) == GWCVars.CACHE_USE_WMS_BACKEND_VALUE) { if (backendExpire == -1) { this.expireCacheList.set(0, new ExpirationRule(0, 7200)); log.error( "Layer profile wants MaxAge from backend," + " but backend does not provide this. Setting to 7200 seconds."); } else { this.expireCacheList.set(backendExpire, new ExpirationRule(0, 7200)); this.expireClientsList.set(0, new ExpirationRule(0, 7200)); log.error( "Layer profile wants MaxAge from backend," + " but backend does not provide this. Setting to 7200 seconds."); } else { this.expireClientsList.set(0, new ExpirationRule(0, backendExpire)); log.trace("Setting expireClients to: " + expireClients);
private int getExpiration(ArrayList<ExpirationRule> list, int zoomLevel) { int retVal; int length = list.size(); if (length == 1) { retVal = list.get(0).getExpiration(); } else { int i; for (i = 1; i < length; ) { if (list.get(i).getMinZoom() > zoomLevel) { break; } i++; } retVal = list.get(i - 1).getExpiration(); } if (retVal == GWCVars.CACHE_USE_WMS_BACKEND_VALUE) { return 7200; } return retVal; }
/** * Gets the expiration time for tiles in the cache, based on the expiration rules from {@link * GeoServerTileLayerInfo#getExpireCacheList()}. If no matching rules are found, defaults to * {@link GeoServerTileLayerInfo#getExpireCache()} * * @see org.geowebcache.layer.TileLayer#getExpireCache(int) * @param zoomLevel the zoom level used to filter expiration rules * @return the expiration time for tiles at the given zoom level */ @Override public int getExpireCache(int zoomLevel) { if (info.getExpireCacheList() != null) { ExpirationRule matchedRule = null; for (ExpirationRule rule : info.getExpireCacheList()) { if (zoomLevel >= rule.getMinZoom()) { matchedRule = rule; } else { // ExpirationRules should be zoomlevel ascending break; } } if (matchedRule != null) { return matchedRule.getExpiration(); } } return info.getExpireCache(); }
if (getExpireCache(0) == GWCVars.CACHE_USE_WMS_BACKEND_VALUE) { if (backendExpire == -1) { this.expireCacheList.set(0, new ExpirationRule(0, 7200)); log.error( "Layer profile wants MaxAge from backend," + " but backend does not provide this. Setting to 7200 seconds."); } else { this.expireCacheList.set(backendExpire, new ExpirationRule(0, 7200)); this.expireClientsList.set(0, new ExpirationRule(0, 7200)); log.error( "Layer profile wants MaxAge from backend," + " but backend does not provide this. Setting to 7200 seconds."); } else { this.expireClientsList.set(0, new ExpirationRule(0, backendExpire)); log.trace("Setting expireClients to: " + expireClients);
expireCacheList.add(new ExpirationRule(0, GWCVars.CACHE_NEVER_EXPIRE)); } else { int expireCacheInt = Integer.parseInt(expireCache); saveExpirationHeaders = true; expireCacheList.add(new ExpirationRule(0, expireCacheInt)); expireClientsList.add(new ExpirationRule(0, 7200)); } else { int expireClientsInt = Integer.parseInt(expireClients); expireClientsList.add(new ExpirationRule(0, expireClientsInt));