Skip to content

Cache breaking rules

Mark Croxton edited this page Feb 4, 2014 · 10 revisions

Cache-breaking rules can be used to clear specific variables, or groups of variables, after creating or editing content.

Creating rules

Start a rule by selecting the 'hook' you want to use as the trigger event. You may use the same hook multiple times for different rules.

Hooks

Expressionengine hooks are triggered by specific events in ExpressionEngine: for example, after publishing, editing or deleting an entry.

Many third party add-ons provide their own hooks, and you can also create custom hooks for use with the Mustash API.

When your hook is triggered ALL variables in the current site will be cleared, UNLESS you use the following fields to limit the action of each rule:

Group

A group is the parent grouping of the item that is being edited. For example, an entry might be published in the 'blog' channel, so it's parent group would be 'blog'. Choose a group to limit your rule to items that you edit within that group only.

Bundle

Choose a bundle name to limit your rule to variables assigned to that bundle only.

Scope

Choose a scope to limit your rule to variables within that scope only.

Pattern

The pattern field allows you to enter a string or MySQL-flavoured regular expression to match variable names. Some hooks allow you to use {markers} in the pattern. Click the 'Need help?' button to view the markers available for each hook.

Example patterns
my_variable
my_context:my_variable
#^my_context:my_variable$#
#^my_context:{url_title}$#
Clone this wiki locally