GDPR API Data Isn’t Cached
-
While reviewing our site’s performance, we noticed that the MailChimp for WooCommerce plugin makes a synchronous API request to update GDPR fields on every page load. It first calls a function names “getCachedGDPRFields” but the cache never hits, so it loads through every time. Since there doesn’t seem to be a way to enable the cache or disable the GDPR field fetching, could you help us out with this? Here’s the full report:
Mailchimp for WooCommerce — GDPR fields API call (411ms, 45% of request)
The function MailChimp_WooCommerce_MailChimpApi::getGDPRFields() is called via getCachedGDPRFields() on pages that include WooCommerce account or registration forms. Despite the method name suggesting caching, the trace shows a live HTTP request to us15.api.mailchimp.com on every invocation. The call chain is:MailChimp_Newsletter::applyNewsletterField (411ms)
?? MailChimp_WooCommerce_MailChimpApi::getCachedGDPRFields (411ms)
?? MailChimp_WooCommerce_MailChimpApi::getGDPRFields (411ms)
?? MailChimp_WooCommerce_MailChimpApi::get (410ms)
?? External/us15.api.mailchimp.com (410ms)This is the largest time consumer in any traced request. The GDPR fields data is unlikely to change frequently and should be cached with a reasonable TTL (hours or days) rather than fetched live on every page load. The worst-case observed time for this call is 4.36s.
You must be logged in to reply to this topic.