Improve cache invalidation with new webhooks module

How to implement

Step 1. Install Webhooks module

Step 2. Create webhook endpoint in Storefront Application

Webhook notifications are sent in the background via a POST request with JSON serialized event data to the specified URL.

  1. Create a new Api Controller
  2. Add dependency from IStorefrontMemoryCache
  3. Add a new POST Method to read incoming events

Step 3. Implement Cache invalidation logic

  1. Parse Incoming Event from JSON. Example of notification, sent on Order creation
  2. Call Cache Invalidation method

Step 4. Configure a new endpoint in WebHook module

  1. Go to Admin
  2. Configure a new webhook endpoint
1 Like