Cache Management
The Cache group controls how long WordPress API responses are cached in Magento and whether webhook-based cache purging is enabled.
Admin path: Stores > Configuration > Orange Collar > WordPress Integration > Cache
Settings
Section titled “Settings”Cache Lifetime (seconds)
Section titled “Cache Lifetime (seconds)”How long post, tag, and general API responses are cached.
- Default: 1800 (30 minutes)
- Applies to: posts, tags, search results, author data, media
Category/Tag Cache Lifetime (seconds)
Section titled “Category/Tag Cache Lifetime (seconds)”How long category and tag listing data is cached. Categories and tags change less frequently than posts, so a longer cache lifetime is appropriate.
- Default: 86400 (24 hours)
Enable Webhook Cache Purge
Section titled “Enable Webhook Cache Purge”When enabled, Magento accepts POST requests from the WordPress plugin that trigger targeted cache purges when content changes in WordPress.
- Default: No (disabled)
- Requires the Magento webhook URL to be entered in the WordPress plugin settings
Cache Tags
Section titled “Cache Tags”The module uses Magento’s tagged cache system. Each cached item is tagged so it can be purged precisely when related content changes.
| Tag | What It Covers |
|---|---|
WORDPRESS_POST | All post data |
WORDPRESS_POST_{id} | A specific post by ID |
WORDPRESS_CATEGORY | All category data |
WORDPRESS_TAG | All tag data |
WORDPRESS_MENU | All menu data |
WORDPRESS_AUTHOR | All author data |
WORDPRESS_AUTHOR_{id} | A specific author by ID |
Webhook Purge Flow
Section titled “Webhook Purge Flow”When a post is updated in WordPress:
- oc-magento-bridge
save_posthook fires - Plugin sends a signed POST to your Magento webhook URL (
/wordpress/webhook/cachepurge) - Magento verifies the HMAC-SHA256 signature in the
X-OC-Bridge-Signatureheader - Magento maps the
object_typefrom the webhook payload to cache tags - Tagged cache entries are purged from Magento’s cache backend
The webhook payload looks like:
{ "event": "post_updated", "object_type": "post", "object_id": 42, "slug": "my-post-slug", "timestamp": 1700000000}Object type to cache tag mapping:
object_type | Tags Purged |
|---|---|
post | WORDPRESS_POST, WORDPRESS_POST_{id} |
page | WORDPRESS_POST, WORDPRESS_POST_{id} |
category | WORDPRESS_CATEGORY |
post_tag | WORDPRESS_TAG |
nav_menu | WORDPRESS_MENU |
Cron Jobs
Section titled “Cron Jobs”Two cron jobs run automatically:
- WarmCache - pre-warms the post cache by fetching the first page of posts every 4 hours
- SyncCategories - syncs category data daily at 3:00 AM
See Cron Jobs reference for full details.