For effective, efficient and scalable portlet design, the mantra is cachability. Portal and WCM are all about caching. Without caching, Portal and WCM cannot and will not scale.
Given that view, this entry discusses optimal portlet design. Optimal, in this case, means "cache as much as possible and only personalize as you must and as late as possible".
With that perspective, the answer is straightforward. Try to design portlets so that the markup is common to all users in the portlet and anything unique to a user is delivered via AJAX at browser render time.
With that perspective, the answer is straightforward. Try to design portlets so that the markup is common to all users in the portlet and anything unique to a user is delivered via AJAX at browser render time.
If done this way, the portlet is very cachable. One can imagine that the doView and JSP that render a portlet deliver the same HTML to all users as well as the same CSS (if needed) and Javascript. Since this is all the same content for every user, the portlet is cachable. It is thus available for portlet caching. Portlet caching is a technique in Portal to greatly speed up renders and scalability.
Once this portlet is delivered the client browser, the browser can make AJAX calls to get the content that is specific to that user, populate the rest of the DOM and complete the render. These AJAX calls are authenticated and so security is preserved and only information destined to a particular user will be rendered.
Once this portlet is delivered the client browser, the browser can make AJAX calls to get the content that is specific to that user, populate the rest of the DOM and complete the render. These AJAX calls are authenticated and so security is preserved and only information destined to a particular user will be rendered.