Improve performance of last acceptance check on contact load
GDPR adds a page hook to the contact dashboard which loads activities of ‘SLA Acceptance’ type through APIv3. Despite being limited to 1 result, this can apparently cause performance issues on sites with a large number of activities.
This pull request does two things:
- Changes the API request to version 4. Not sure why, but this is a lot faster than v3 for this call.
- Adds persistent caching to this check for 1 day.
A possible improvement to this would be when a SLA Acceptance activity is created to update the cached value at that time; this has not been implemented yet.