I found a situation where I want to clear the cache. I went to the site manager > administration > system > debug > cache items and found the cache key that I need to clear. If I remove this key using this interface, it flushes the cache as desired. The key is:
cmsdatasource||en-us|surroundhealth|/topics/my-groups/the-alliance-of-professional-health-advocates/topic-archives/test2|en-us|false|custom.article|||-1|true|0||false
I then tried do the same through the API.
At first I tried using the node ID, since this just is just a single custom document. I ran CacheHelper.TouchKey("nodeid|2312"), which didn't work. The changes aren't apparent when I view the page on the live site. So I tried to flush all documents of that type: CacheHelper.TouchKey("custom.article|all"), which didn't work.
So I tried the full key above, and then I got this error when I view the page:
Unable to cast object of type 'CMS.GlobalHelper.DummyItem' to type 'System.Data.DataSet'.
[InvalidCastException: Unable to cast object of type 'CMS.GlobalHelper.DummyItem' to type 'System.Data.DataSet'.]
CMS.GlobalHelper.CacheHelper.TryGetItem(String key, Boolean caseSensitive, OutputType& output, Boolean logOperation) +418
CMS.GlobalHelper.CacheHelper.TryGetItem(String key, OutputType& value) +74
CMS.GlobalHelper.CachedSection`1.GetData() +110
CMS.GlobalHelper.CachedSection`1..ctor(DataType& result, Int32 cacheMinutes, Boolean condition, String customCacheItemName, Object[] cacheItemNameParts) +103
CMS.Controls.CMSAbstractDataProperties.GetDataSet(String path, String where, Boolean forceReload) +1654
CMS.Controls.CMSAbstractDataProperties.LoadData(Object& DataSource, Boolean forceReload) +244
CMS.Controls.CMSRepeater.ReloadData(Boolean forceReload) +1668
CMS.Controls.CMSRepeater.OnInit(EventArgs e) +178
System.Web.UI.Control.InitRecursive(Control namingContainer) +186
System.Web.UI.Control.InitRecursive(Control namingContainer) +421
System.Web.UI.Control.InitRecursive(Control namingContainer) +421
System.Web.UI.Control.InitRecursive(Control namingContainer) +421
System.Web.UI.Control.InitRecursive(Control namingContainer) +421
System.Web.UI.Control.InitRecursive(Control namingContainer) +421
System.Web.UI.Control.InitRecursive(Control namingContainer) +421
System.Web.UI.Control.InitRecursive(Control namingContainer) +421
System.Web.UI.Control.InitRecursive(Control namingContainer) +421
System.Web.UI.Control.InitRecursive(Control namingContainer) +421
System.Web.UI.Control.InitRecursive(Control namingContainer) +421
System.Web.UI.Control.InitRecursive(Control namingContainer) +421
System.Web.UI.Control.InitRecursive(Control namingContainer) +421
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2098
How can I clear this item from the cache using the API?