Date lastExpirationDate =
(Date) CacheManager.getLastExpiredDate(pageRequest.getWeblogHandle());
if(lastExpirationDate != null)
lastExpiration = lastExpirationDate.getTime();
LazyExpiringCacheEntry entry =
(LazyExpiringCacheEntry) this.mCache.get(key);
if(entry != null) {
respContent = (ResponseContent) entry.getValue(lastExpiration);
if(respContent == null)
mLogger.debug("HIT-INVALID "+key);
}
}
if (respContent == null) {
mLogger.debug("MISS "+key);
this.misses++;
CacheHttpServletResponseWrapper cacheResponse =
new CacheHttpServletResponseWrapper(response);
chain.doFilter(request, cacheResponse);
cacheResponse.flushBuffer();
// Store as the cache content the result of the response
// if no exception was noted by content generator.
if (request.getAttribute("DisplayException") == null) {
ResponseContent rc = cacheResponse.getContent();
// only cache if this is not a logged in user?
if (!this.excludeOwnerPages || !pageRequest.isLoggedIn()) {
if (rc != null && rc.getSize() > 0) {
this.mCache.put(key, new LazyExpiringCacheEntry(rc));
} else {
mLogger.debug("Not caching zero length content for key: " + key);
}
} else {
mLogger.debug("SKIPPED "+key);