Cache component is used to reduce page load time by caching the content in a global cache after the initial rendering. Various cache providers are supported like ehcache and hazelcast. Showcase use actually this component to render source examples for every PrimeFaces components. Why? Because parsing an xhtml file takes time, and since the rendering won't change during the whole lifecycle of the application, it's better to cache the content.

  • tabscode.xhtml demonstrate how to use cache component declaratively
  • ShowcaseUtil demonstrate how to use cache API programmatically

<p:tabView var="entry" value="#{value}">
<p:tab title="#{entry.title}" >
    <p:cache region="sources" key="#{entry}"
             disabled="#{facesContext.application.projectStage eq 'Development'}">
        <pre name="code" class="brush:#{entry.type}">#{entry.value}</pre>

<f:facet name="static-tabs">
    <ui:insert />


Built-in component themes created by the PrimeFaces Theme Designer.

nova-light Nova-Light
nova-dark Nova-Dark
nova-colored Nova-Colored
luna-blue Luna-Blue
luna-amber Luna-Amber
luna-green Luna-Green
luna-pink Luna-Pink
omega Omega


Create awesome applications in no time using the premium templates and impress your users.