How to configure Cache Profile in Page Layout using Features

Feature framework can be used to deploy Page Layouts. After you have deployed a page layout you could configure the Cache Profile that needs to be assigned to the Page Layout using UI. But what if your requirement was to pre-configure the same with deployment of page layout itself. To know the Cache Profile that needs to go with the Page Layout you need to know its Item ID and the title. Cache Profile is configured as a metadata column on the Master Page gallery. To enable the same I had to modify the elements.xml as shown below.


<Elements xmlns=""> 
    <Module Name="PageLayouts" Url="_catalogs/masterpage" Path="PageLayouts" RootWebOnly="TRUE"> 
        <File Url="CareerLayoutsCTFeature.aspx" Type="GhostableInLibrary"> 
            <Property Name="Title" Value="HR Page Layout" /> 
            <Property Name="MasterPageDescription" 
Value="Page with image on top contains an image field and richtext field." /> 
            <Property Name="ContentType" Value="Page Layout" />       
            <Property Name="PublishingAssociatedContentType" 

<Property Name="AnonymousCacheProfile" Value="2;#Public Internet (Purely Anonymous)"/> 
Skip to main content