• 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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support KJ

    (@kjvextras)

    Hi @tobet thanks for reaching out and bringing this to our attention – This is a known performance issue with the Mailchimp for WooCommerce plugin where GDPR fields are fetched on every page load despite the getCachedGDPRFields() method name suggesting caching functionality. Let me talk to my team so we can provide you with some solutions. I will swing back around.

    Chat soon.

    Thread Starter tobet

    (@tobet)

    Hi @kjvextras, thank you for reaching out to your team.

    Let me know if you have any updates!

    Thread Starter tobet

    (@tobet)

    On further testing, the MailChimp for WooCommerce plugin does appear to be caching the GDPR fields for 5 minute increments. Testing indicates that the fields are being successfully cached on cURL response (array(0) { }) and loaded in on further page loads.

    So, unlike originally suspected, the plugin does not appear to be making a synchronous API call on “every page load” but only once every 5 minutes. Ideally, since GDPR fields don’t change often, the cache time should be longer than 5 minutes (or configurable in the admin interface).

    Plugin Support KJ

    (@kjvextras)

    Ahhhh thanks @tobet I will take this back to the team

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.