How To Configure a Trigger to Clear Cache on Updated Assets

Intermediate

28 Sep 2016   By Bartek Banda   For version 5.0.0.0   Triggers

This tutorial will show you how to configure a global Trigger to clear the Matrix Cache of assets whenever they are updated.

To configure the Trigger, follow these steps:

  1. Create a new Trigger asset.
  2. Set the Status to Enabled and enter a Name and Description, for example:

  3. In the Events section, select the Asset Updated event.
  4. Leave the Conditions section empty. The main reason for this is that it will make the Trigger very fast to execute. We want to clear the cache on any asset after it has been updated and it doesn't matter if it clears it when we don't really need it to.
  5. In the Actions section, select the Clear Matrix Cache Trigger Action and click Commit. You should now see the configuration area for this Trigger Action as shown in the example below:
  6. Enable the Ignore Permissions field to ignore the access rights of the user/s firing this trigger so that cache can be successfully cleared on all asset's that get updated by the user.

To confirm that the Trigger works, you can test it by editing the contents of a Standard Page and saving the screen. Afterwards, check the system log in the Log Manager and you should see entries similar to this:

[trigger.event_log - assetid:17:1;] (Trigger Execution Success) - SUCCESS
Trigger "Clear Matrix Cache" (#1), Event: "trigger_event_asset_updated" broadcast by Asset: "About Us" (#7101))

Write a Tutorial

Help us build a healthy library of useful tutorials for the Matrix Community.

Get in Touch

The Latest

Let Us Know What You Think

Let us know if you spot any errors or if you have any ideas on how we can improve the Matrix Community Website.

Contact Squiz for Demo

Let us show you the true power of Squiz Matrix by giving you a personalised demonstration.