[Opensymphony-oscache] CacheEntry::needsRefresh

Lars Torunski <[email protected]>
Newsgroups gmane.comp.java.open-symphony.os-cache
Message-ID <33382158.1112729970499.JavaMail.os-j2ee@opensymphony01.contegix.com>
The problem is that the EntryRefreshPolicy ignores the refreshPeriod. I expected a method interface signature like

    public boolean needsRefresh(CacheEntry entry, int refreshPeriod)

As a workaround I can change the CacheFilter::doFilter

                // Only cache if the response was 200
                if (cacheResponse.getStatus() == HttpServletResponse.SC_OK) {
                    // check if expires refresh policy has to be set [CACHE-160]
                    ResponseContent content = cacheResponse.getContent(); 
                    ExpiresRefreshPolicy policy = (content.getExpires() == ResponseContent.INDEFINITE_EXPIRY) ? null : EXPIRES_REFRESH_POLICY;
                    //Store as the cache content the result of the response
                    cache.putInCache(key, content, policy);
                    updateSucceeded = true;
                }

---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=1283&messageID=4106#4106
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.