You could have the same logic within a method to clear your JSP, servlets cache when you wanted to do so. Actually by calling appropriate session.invalidate(), will clear all session stored items for a particular session.
No pain, No gain.
OCJP 1.6, Liferay Certified Developer 6.1
say i have a logout link and it is redirecting to lo-gout servlet
You can configure filters to intercept request/responses before reaching/coming from the servlet. So, upon clicking "logout" it is expected to go to servlet and you can configure a filter before it goes to the actual servlet.
But this has nothing to do with clearing cache. As Bear pointed out, you need to refer the link he provided.