Cache 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. In this example, toolbar component is cached and output would be retrieved from cache.
<h:form>
    <p:cache region="testcache" key="toolbar">
        <p:toolbar>
            <p:toolbarGroup align="left">
                <p:commandButton type="button" value="New" icon="ui-icon-document" />

                <p:commandButton type="button" value="Open" icon="ui-icon-folder-open"/>

                <p:separator />

                <p:commandButton type="button" title="Save" icon="ui-icon-disk"/>
                <p:commandButton type="button" title="Delete" icon="ui-icon-trash"/>
                <p:commandButton type="button" title="Print" icon="ui-icon-print"/>
            </p:toolbarGroup>

            <p:toolbarGroup align="right">
                <p:commandButton type="button" value="Quit" icon="ui-icon-close"/>
            </p:toolbarGroup>
        </p:toolbar>
    </p:cache>
</h:form>
                
PrimeTek, Copyright © 2017
All rights reserved.
Running PrimeFaces-6.1.4 on Mojarra-2.2.10.