New approaches to ACL caching (and smart groups?)
A lot of work has gone into improving the efficiency and frequency of ACL calculation. Let's attack the performance of writing the results to db?
I have a site where contacts change frequently, and ACLed users need to wait for 100,000 records to be written each time. Disabling opportunistic flushes only partly mitigates the issue.
Here are some ideas:
- Could we move ACL/smart group caching into
\Civi::cache
? Then we could use Redis etc. - Instead of truncating and writing all contacts - what if we only
INSERT
andDELETE
changes from the existing cache? - When a contact's edited, could we just calculate cache for that contact? For any ACL based on a static group, this should be trivial. Even with smart groups/custom code - are there scenarios where we'd ever need to calculate ACLs for anyone but the changed contact and all their related contacts?