Nov 22nd, 2005, 04:08 AM
Portlet Cache control API
I am working on a custom portal application consisting of approximately 10 portlets, around 5 shown on one page which have dependencies to eachother.
I face the problem of portlet caching: if i enable caching i cant update the portlets where the action is not originating from, when I dont use caching all the portlets get rendered all the time and that is a major performance drawback.
I would need a solution to get the render request and be able to give back a return value meaning "take the page in the cache". I need the request to be able to check if a refresh is necessary, but have to be able to avoid the whole bunch of access control and other things necessary for rendering if no refresh is needed.
I had a look on the API in the class org.springframework.web.portlet.support.PortletCon tentGenerator and org.springframework.web.portlet.mvc.AbstractContro ller, but those APIs seem only to cover the future of the page caching. As soon as I get the request, I have to re-render the page.
Is there a solution to that or have I missed something in the docs?
The portal which i develope for is liferay, but the solution should be as standard comform as possible.
Dec 21st, 2005, 01:16 AM
Unfortunately, there is no way to do this. The only caching mechanisms defined in the JSR-168 spec is the time-based expiration cache that you have already seen. Review chapter PLT.18 in the JSR-168 spec for more details on this.
So, what you are looking for would have to be some kind of custom feature in the Portal platform you are using and would probably be expressed as an attribute in the RenderResponse or something. But this would be completely outside the scope of Spring Portlet MVC and would be strictly between you and your Portal vendor.