How to disable output caching for site pages?

I tried disabling output caching from Site settings but I could not see any output caching in the Site setting collection administration menu, even in publishing infrastructure mode.

I want to know how I could make this change with PowerShell. I also want to disable caching on the page level.

   //I tried this on a page but it rises an error:
   <%@ OutputCache Location="None" %>

How can this be done?

  • are you site collection admin? which version of sharepoint you are using? is it publishing site or site with publishing feature active? try to browse this page: sitecolelction url/_Layouts/sitecachesettings.aspx – Waqas Sarwar MVP Aug 27 '14 at 11:59
  • thanks all caching are disabled to me : but the problem happen to me always why the Xsltlistviewwebpart dipslaying Splist Items could not Refresh or display the SList View in real time but cache me the last view items any idea. – ezzaam Aug 27 '14 at 12:58
  • i am not sure about it. – Waqas Sarwar MVP Aug 27 '14 at 12:59

A SharePoint Publishing site can also be configured to make use of the ASP.NET output cache to store rendered ASPX pages in memory. You can only make use of this cache when the P**ublishing features are activated on your site collection. This means that only publishing pages can be cached.

User must be a site collection administrator or have full control within web application policy to modify this settings.

Here is code to disable it:


$cacheSettings = new-object Microsoft.SharePoint.Publishing.SiteCacheSettingsWriter($Url); 
$cacheSettings.EnableCache = $true; 

Save the file as DisableOutputCache.ps1 and run like this

powershell "& ./DisableOutputCache.ps1 -Url http://dev-moss.com"



|improve this answer|||||
  • i did that i found it thanks a lot all caching settings are disabled but the problem still with XsltListViewWebPart – ezzaam Aug 27 '14 at 13:01
  • why is $cacheSettings.EnableCache = $true; Disable cache? shouldn't it be $cacheSettings.EnableCache = $false; ? – user25682 Jun 19 '15 at 3:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.