Caching can greatly improve performance when used wisely. For example:
Cache EJB references: To avoid a JNDI lookup for every request, cache EJB references in servlets.
Cache home interfaces: Since repeated lookups to a home interface can be expensive, cache references to EJBHomes in the init() methods of servlets.
Cache EJB resources: Use setSessionContext() or ejbCreate() to cache bean resources. This is again an example of using bean lifecycle methods to perform application actions only once where possible. Remember to release acquired resources in the ejbRemove() method.