How To Configure a Trigger to Clear Cache on Updated Assets
Intermediate
28 Sep 2016 By Bartek Banda For version 5.0.0.0
This tutorial has been superseded by a setting on the Details screen of the Cache Manager called "Clear Asset Cache Automatically". Using this setting removes the need to create this type of cache clearing trigger.
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:
- Create a new Trigger asset.
- Set the Status to Enabled and enter a Name and Description, for example:
- In the Events section, select the Asset Updated event.
- 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.
- 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:
- 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))
Tutorials
Topics
- Accessibility
- Builders
- Content
- Calendars
- Design
- E-Commerce
- Edit+
- Forms
- Integration
- Listings
- Metadata
- Search
- Server Side JS
- Squiz Edge
- Templates
- Triggers
Levels
Write a Tutorial
Help us build a healthy library of useful tutorials for the Matrix Community.
The Latest
Tutorials
- 02 Jul 2019
- 28 May 2019
- 30 Jul 2018
- 12 Jul 2018
-
How To Create an Upcoming Events Listing Using a Calendar Search Page
18 Jun 2018 - 19 Apr 2018
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.