Manually reset cache after bulk insert.

Ben Janssen asked on October 11, 2018 15:24

Im doing a bulk insert to insert records into a custom module class table.

ConnectionHelper.BulkInsert(DataToAdd, "Custom.ObjectTable1", bulkInsertSettings);

This event is not clearing the cached list of records on the site. IS there a way to manually kill the cached list after the insert?

if (cs.Cached){ cs.CacheDependency = CacheHelper.GetCacheDependency(new string[] {"Custom.Object1|all", "nodeid|"+GridNode.NodeID, "Custom.Object2|all" }); }

Correct Answer

David te Kloese answered on October 11, 2018 15:34

manually as in via code? or in person clicking a button in the admin interface?

in code try something like: CacheHelper.TouchKey("YourCustom.ObjectType|all");

If it's a developer instance and one time import try the following button in the System module:

clear cache

NOTE: this will clear ALL cache, if you do this on a production site expect some slow behavior after.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Ben Janssen answered on October 11, 2018 15:43

Its in code yes. And will be used often. It's basically a list of people. clicking a button inserts these people in a joined table and the result will be an updated field on the list page. But the list of people is cached and not getting updated.

I'll look into TouchKey. Thanks David.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.