views:

81

answers:

1

In sharepoint we can clear object cache from Site Collection Administration - Site collection object cache

Is there a way to do the same programmatically ?

A: 

Hi Dilbert

You can't do the same as "Object Cache Flush" programmatically. (It uses internal objects)

But you can do the same as "Force all servers in the farm to flush their object cache" by:

SiteCacheSettingsWriter writer=new SiteCacheSettingsWriter(site);
writer.SetFarmCacheFlushFlag();
writer.Update();
Per Jakobsen
Thanks Jakobsen, that was cool :)
Dilbert