-
Notifications
You must be signed in to change notification settings - Fork 67
Using Caches
Welcome to the guide on Using Caches in the MailChimp for WooCommerce Integration. This guide will help you understand how to configure your caching plugins appropriately to ensure optimal performance while maintaining functionality.
The "overview" screen of the plugin makes calls to the WP REST API to show you stats on how your sync is progressing. If you're using a caching system, you might see zeros across the board on your stats. This is by design. Your cache is returning the "last result" it had saved to speed up your site in other areas.
- When "admin caching" and "REST API" features are enabled, the Action Scheduler may be prevented from running properly (limited to a few times per day)
- May interfere with real-time sync statistics
- Navigate to Cache > Excludes and add the following URI:
^/mailchimp-for-woocommerce/
-
Under Cache > Object settings:
- Disable wp-admin caching
- Ensure REST API caching is disabled for MailChimp routes
-
Create a Page Rule to bypass cache for:
- WP Admin area
- REST API endpoints
- MailChimp for WooCommerce specific routes
-
Exclude critical pages from caching:
- My Account
- Checkout
- Cart
Different caching plugins use various syntax for exclusions:
- Some use asterisks:
mailchimp-for-woocommerce/*
- Others use percentage signs:
mailchimp-for-woocommerce/%
- LiteSpeed uses regex:
^/mailchimp-for-woocommerce/
Consult your specific caching plugin's documentation for the correct exclusion syntax.
Always ensure these pages are excluded from caching:
- My Account
- Checkout
- Cart
- WP Admin area
- REST API endpoints related to MailChimp
To ensure reliable syncing, set up a server-side cron job:
-
Add this to your crontab (replace with your domain):
*/1 * * * * wget https://your_wp_site/wp-cron.php
-
Add to wp-config.php:
define('DISABLE_WP_CRON', true);
For larger stores, enable high performance mode by adding to wp-config.php:
define('MAILCHIMP_HIGH_PERFORMANCE', true);
define('MAILCHIMP_HIGH_PERFORMANCE_PROCESSES', 20);
Note: Adjust the number of processes based on your server's resources.