7

The Manage Groups page in Civi 4.5+ displays counts of contacts in each group, and in the process refreshes the smart group contact cache. We've turned off this cache elsewhere as it takes 10mins to complete (we have a lot of groups) - but the Manage Groups page seems to force a refresh. Is there a way to disable this refresh?

I can't see a setting, so am assuming it'd involve commenting out some code. I found the code in Contact/BAO/Group.php that I think disables the count of the contacts, but can't figure out where the cache-refresh itself takes place.

6

The manage groups page does not force a refresh of the smart group cache but there is a button to do so on the right-hand side: Smart group refresh

Without clicking that button, what it does do is count the number of contacts already in the cache, but this query has been optimized and tested against a very large (6 million group_contact records) database.

You'll find more information at https://issues.civicrm.org/jira/browse/CRM-15107

  • Thanks! Just figured this out: in Group/Page/Group.php there's a call to fillIfEmpty() that refreshes the cache only if the smart group cache has literally nothing at all. That's where I was going wrong - the cache was empty on my first test, then I was manually truncating to test it. – Andrew West Mar 25 '15 at 16:39
  • We learn something new everyday ;-) Thanks helped me answer a question about how to deal with Smart Groups showing as having 0 contacts at Manage Groups – petednz - fuzion Jun 2 '16 at 5:52

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.