I am using DataClassInfo classInfo = DataClassInfoProvider.GetDataClassInfo(classname) to get the field names that are associated with a class. I want to cache those field names, which is easy, but cant figure out how to clear the cache data when the fields for that class are modified. I have looked at the Setting cache dependencies documentation but it doesnt provide what I need. Anybody have any brilliant ideas?
DataClassInfo classInfo = DataClassInfoProvider.GetDataClassInfo(classname)
Hi Laura,
I'm not sure that it's necessary to cache DataClassInfo object, because DataClassInfoProvider uses HashTable inside, which is populated for the first time and is cleared, if class is modified.
Have you tried to set cache dependency like this:
cms.class|byid|53
Also you may workaround this by dropping your cache item in the following event handler CMS.DataEngine.DataClassInfo.TYPEINFO.Events.Update.After
CMS.DataEngine.DataClassInfo.TYPEINFO.Events.Update.After
Please, sign in to be able to submit a new answer.