
|
If you were logged in you would be able to see more operations.
|
|
|
OSCache
Created: 16/Sep/03 05:27 AM
Updated: 23/Jan/05 04:41 PM
|
|
| Component/s: |
Filters
|
| Affects Version/s: |
2.0.2
|
| Fix Version/s: |
2.1
|
|
|
say i have a servlet that has overridden the getLastModifed method to return the last time the response was modified. client can use this info while making a conditional request using the "If-Modified-Since" header. if the content has not been modified since the time specified then just 304 status is returned and no content. this can reduce traffic a lot if the content changes infrequently.
now say i use the cache filter from oscache. in this case it just look for the response content in the cache. if it is there then the whole content is written to the servlet outputstream and the If-Modified-Since header is completely ignored.
you already have the last updated time info in the cache entry class. can that be used together with "If-Modified-Since" header in cache filter.
i had one more suggestion. suppose i have many pages on my site that change quite infrequently, say once a day. these pages are large too. so i want to save the response on disk not just as is but also in gzip format. so if any client accepts gzip encoding i can send him the gzip cached version, which should be much smaller than the full blown version. can this be incorporated. sample of compress filter comes with the source code of tomcat.
one more thing. while generating the key in cache filter null is passed as the first argument to the following method.
admin.generateEntryKey(null, (HttpServletRequest) request, cacheScope)
can this be changed to some request attribute, say
"com.opensymphony.module.oscache.web.filter.CacheEntryKey". i mean if this attribute is set in the request then that key is passed else null is passed. this way i can pass some sensible keys, not some MD5 encoded key.
thanks,
nishant.
|
|
Description
|
say i have a servlet that has overridden the getLastModifed method to return the last time the response was modified. client can use this info while making a conditional request using the "If-Modified-Since" header. if the content has not been modified since the time specified then just 304 status is returned and no content. this can reduce traffic a lot if the content changes infrequently.
now say i use the cache filter from oscache. in this case it just look for the response content in the cache. if it is there then the whole content is written to the servlet outputstream and the If-Modified-Since header is completely ignored.
you already have the last updated time info in the cache entry class. can that be used together with "If-Modified-Since" header in cache filter.
i had one more suggestion. suppose i have many pages on my site that change quite infrequently, say once a day. these pages are large too. so i want to save the response on disk not just as is but also in gzip format. so if any client accepts gzip encoding i can send him the gzip cached version, which should be much smaller than the full blown version. can this be incorporated. sample of compress filter comes with the source code of tomcat.
one more thing. while generating the key in cache filter null is passed as the first argument to the following method.
admin.generateEntryKey(null, (HttpServletRequest) request, cacheScope)
can this be changed to some request attribute, say
"com.opensymphony.module.oscache.web.filter.CacheEntryKey". i mean if this attribute is set in the request then that key is passed else null is passed. this way i can pass some sensible keys, not some MD5 encoded key.
thanks,
nishant. |
Show » |
|