We have been fighting a little with the cache system in Jetspeed 1.3.a1.
Our goal was that of showing real time data in a portlet presenting a
RSS page generated with JSP. But we had problems because the portlet
content was not refreshed when the user was hitting the refresh button
in his web browser.
Why?
Answer: cache system.
Two different kinds of cache are acting in the portlet; the first one is
caching the portlet object in memory and the second one is caching the
URL that the portlet is using. This second cache is called the
DiskCache. There is a third class of cache, but it is only working for
the channels defined in OCS and it is known as FeedCache.
The DiskCache has mainly two types of URL: locals and remotes. The
locals are not cached and are directly get from the URL source ( so if
your page is local you will not have problems). The DiskCache recognizes
as locals the next types of URLs:
/test/test
http://localhost
http://127.0.0.1
http://ourserver.domainame
Notice that the URL "http://ourserver" is considered as remote...
The remotes URL are refreshed by the DiskCacheDaemon. This daemon runs
with a interval defined in the JR.p; each time it runs it takes all the
URL from the DiskCache and renews that ones that are remote and have
passed over their "expiration time". This expiration time is hard coded
in the source of DiskCacheEntry.java and it is equal to 15 minutes.
So what happens if you want to refresh your remote URL in the DiskCache
with a interval lower than 15 minutes, ..well.., you can't, unless you
change DiskCacheEntry to modify the default expiration time.
Then, playing with the "expiration time" and the daemon interval, you
would be able to control the refresh of your portlet lower that 15
minutes ( in fact we wanted a refresh time of 1 minute).
Finally,In both, local and remote URL, we would suggest to "jump" the
"portlet cache". This can be done overwriting the isCacheable() method
as it has been explained in other messages.
Hope this help someone,
Greetings,
Carlos.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]