
|
If you were logged in you would be able to see more operations.
|
|
|
OSCache
Created: 04/Apr/05 07:38 AM
Updated: 08/Apr/05 12:05 AM
|
|
| Component/s: |
Filters
|
| Affects Version/s: |
2.2 RC
|
| Fix Version/s: |
2.2 RC
|
|
|
CacheFilter creates CacheEntry's always with policy set to ExpiresRefreshPolicy, which results in the following behaviour if I specify time initParam in filter definition in web.xml and I don't set expires header in my servlets:
CacheEntry.needsRefresh is called, since policy is set the policy.needsRefresh is checked which compares the current time with the time set in the ResponseContent. Now, since I don't specify any expires, ResponseContent has default value Long.MAX_VALUE, which results in policy always returning false since System.currentTimeMillis() is always less than responseContent.getExpires().
This is not the behaviour I would expect from CacheFilter, if a time initParam is set.
I should not need to set expires header in my servlets in order to use the cachefilter, or should I?
Any suggestions on how to resolve this?
|
|
Description
|
CacheFilter creates CacheEntry's always with policy set to ExpiresRefreshPolicy, which results in the following behaviour if I specify time initParam in filter definition in web.xml and I don't set expires header in my servlets:
CacheEntry.needsRefresh is called, since policy is set the policy.needsRefresh is checked which compares the current time with the time set in the ResponseContent. Now, since I don't specify any expires, ResponseContent has default value Long.MAX_VALUE, which results in policy always returning false since System.currentTimeMillis() is always less than responseContent.getExpires().
This is not the behaviour I would expect from CacheFilter, if a time initParam is set.
I should not need to set expires header in my servlets in order to use the cachefilter, or should I?
Any suggestions on how to resolve this? |
Show » |
|
The problem is that in CacheEntry::needsRefresh the policy is used (if set) to check a needed refresh and not the specified time (in initParam in the filter definition of web.xml).