Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

portlet.xml
...
        <expiration-cache>600</expiration-cache>
        <cache-scope>private</cache-scope>
...
CensusCollectView.java
...
        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);
...
  • No labels