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.
- Create a new Api Controller
- Add dependency from IStorefrontMemoryCache
- Add a new POST Method to read incoming events
Step 3. Implement Cache invalidation logic
- Parse Incoming Event from JSON. Example of notification, sent on Order creation
- Call Cache Invalidation method
Step 4. Configure a new endpoint in WebHook module
- Go to Admin
- Configure a new webhook endpoint