# Improve cache invalidation with new webhooks module

**URL:** <https://www.virtocommerce.org/t/improve-cache-invalidation-with-new-webhooks-module/107>\
**Category:** dev\
**Tags:** module, webhooks, cache\
**Created:** [November 30, 2019, 11:19am UTC](https://www.virtocommerce.org/t/improve-cache-invalidation-with-new-webhooks-module/107 "2019-11-30T11:19:37Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![OlegoO](https://yyz2.discourse-cdn.com/flex032/user_avatar/www.virtocommerce.org/olegoo/32/27_2.png) [@OlegoO](https://www.virtocommerce.org/u/OlegoO)\
**Post date:** [December 5, 2019, 12:56pm UTC](https://www.virtocommerce.org/t/improve-cache-invalidation-with-new-webhooks-module/107/2 "2019-12-05T12:56:41Z")

</div>

# How to implement

## Step 1. Install Webhooks module

> **[VirtoCommerce/vc-module-webhooks](https://github.com/VirtoCommerce/vc-module-webhooks)**
>
> Webhooks functionality. Contribute to VirtoCommerce/vc-module-webhooks development by creating an account on GitHub.

## 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](https://github.com/VirtoCommerce/vc-module-webhooks#sample-of-event-json)
2. Call Cache Invalidation method

## Step 4. Configure a new endpoint in WebHook module

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

---

_[View the full topic](https://www.virtocommerce.org/t/improve-cache-invalidation-with-new-webhooks-module/107)._
