Data Flow
Post Listing Flow
Section titled “Post Listing Flow”Browser -> GET /blog -> Magento Router (matches base path) -> Blog\Index Controller -> PostRepository::getList(page, perPage) -> WordPressCache::load('posts_page_1') [cache hit] -> return cached Post[] [cache miss] -> -> Client::getPosts(['page' => 1, '_embed' => true]) -> GET /wp-json/wp/v2/posts?page=1&_embed=1 -> HTTP response -> Post::fromApiResponse() for each post -> WordPressCache::save(Post[], 'posts_page_1', [WORDPRESS_POST]) -> return Post[] -> Assign posts to Block/ViewModel -> Layout renders blog/index.phtml -> Response to browserSingle Post Flow
Section titled “Single Post Flow”Browser -> GET /blog/my-post-slug -> Magento Router -> resolveRoute('my-post-slug') -> controller: post, action: view -> Post\View Controller -> PostRepository::getBySlug('my-post-slug') -> WordPressCache::load('post_slug_my-post-slug') [cache miss] -> -> Client::getPostBySlug('my-post-slug') -> GET /wp-json/wp/v2/posts?slug=my-post-slug&_embed=1 -> Client::getSeoMeta($post->id) [if SEO enabled] -> GET /wp-json/oc-bridge/v1/seo/42 -> ContentProcessor::process($post->content) -> WordPressCache::save(Post, key, [WORDPRESS_POST, WORDPRESS_POST_42]) -> SeoPlugin injects meta tags into page head -> Layout renders blog/post/view.phtmlWebhook Cache Purge Flow
Section titled “Webhook Cache Purge Flow”WordPress (content saved) -> save_post hook fires -> OC_Bridge_Cache_Webhook::on_post_save() -> wp_remote_post() non-blocking POST to Magento
Magento -> POST /wordpress/webhook/cachepurge -> Webhook\CachePurge Controller -> read X-OC-Bridge-Signature header -> compute HMAC-SHA256(request body, api_key) -> hash_equals(computed, received) [fail] -> 401 response [pass] -> -> parse payload: object_type, object_id -> map object_type to cache tags -> Magento\Framework\App\Cache\TypeListInterface::invalidate(tags) -> 200 OK responseCache Key Strategy
Section titled “Cache Key Strategy”Cache keys use the pattern wp_{type}_{identifier}:
| Data | Cache Key Example |
|---|---|
| Post listing page 1 | wp_posts_page_1 |
| Post by slug | wp_post_slug_my-post |
| Post by ID | wp_post_42 |
| Category listing | wp_categories_all |
| Category by slug | wp_category_slug_news |
| Menu | wp_menu_primary |