Skip to content

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

How long post, tag, and general API responses are cached.

  • Default: 1800 (30 minutes)
  • Applies to: posts, tags, search results, author data, media

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)

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

The module uses Magento’s tagged cache system. Each cached item is tagged so it can be purged precisely when related content changes.

TagWhat It Covers
WORDPRESS_POSTAll post data
WORDPRESS_POST_{id}A specific post by ID
WORDPRESS_CATEGORYAll category data
WORDPRESS_TAGAll tag data
WORDPRESS_MENUAll menu data
WORDPRESS_AUTHORAll author data
WORDPRESS_AUTHOR_{id}A specific author by ID

When a post is updated in WordPress:

  1. oc-magento-bridge save_post hook fires
  2. Plugin sends a signed POST to your Magento webhook URL (/wordpress/webhook/cachepurge)
  3. Magento verifies the HMAC-SHA256 signature in the X-OC-Bridge-Signature header
  4. Magento maps the object_type from the webhook payload to cache tags
  5. 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_typeTags Purged
postWORDPRESS_POST, WORDPRESS_POST_{id}
pageWORDPRESS_POST, WORDPRESS_POST_{id}
categoryWORDPRESS_CATEGORY
post_tagWORDPRESS_TAG
nav_menuWORDPRESS_MENU

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.