...
if (request.getETag() != null) {
System.out.println("Expiration Tag is: "+request.getETag());
if (request.getETag().equals(currentCacheTag)) {
response.getCacheControl().setExpirationTime(20);
response.getCacheControl().setUseCachedContent(true);
return;
}
} else {
System.out.println("Expiration Tag is null");
}
// create new content with new validation tag
session.setAttribute(CACHE_ETAG, CACHE_ETAG);
response.getCacheControl().setETag(CACHE_ETAG);
response.getCacheControl().setExpirationTime(20);
...
|