---
updatedAt: 2026-04-20T19:20:41.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/purge-cache/llms.txt
---

# Path matches

Use the `match` tags, sometimes referred to as *URL component* matches, to specify the URL path to the directory with objects you want to revalidate. The tags create nodes in the metadata file and help to efficiently apply these metadata to requests.

# Match: recursive-dirs

Use `recursive-dirs` to match the specified directory and all its subdirectories. The syntax for this match is:

```
<match:recursive-dirs value=*dir* nocase="off" include-path-params="off">
</match:recursive-dirs>
```

* The `value`attribute is the directory name without the leading or following slash `/`.

* The `nocase`boolean attribute specifies whether the match is be case-sensitive. By default set to `off`.

* The `include-path-params`boolean attribute specifies whether to include the path parameters when matching on a path component. By default set to `off`and ignores the path parameter during the comparison.

`recursive-dirs`matches a single component of the URI path. Make sure you don't combine path components to match a longer portion of the URI path. The following syntax is **not** supported:

```
<match:recursive-dirs value="images/borders">
```

Although the match value is a single component of the URI path, this doesn't mean that the component can exist anywhere in the URI and result in a match. Check this more complete example, where the match tag `<match:recursive-dirs value="images">`is at the root directory.

```
<eccu>
    <match:recursive-dirs value="images">
        <revalidate>1046581729</revalidate>
    </match:recursive-dirs>
<eccu>
```

This match applies to any files that match the URI paths:

```
www.example.com/images/
www.example.com/images/*/
www.example.com/images/*/*/
```

Note that it does **not** apply the `revalidate`tag to:

```
www.example.com/electronics/images/
```

You can include another subdirectory in a separate tag:

```
<match:recursive-dirs value="images">
    <match:recursive-dirs value="borders">
         <revalidate>1046581729</revalidate>
    </match:recursive-dirs>
</match:recursive-dirs>

```

This example applies the `revalidate`tag to all files that match the URI path:

```
www.example.com/images/borders/
www.example.com/images/borders/*/...

```

If you don't want to match recursively, pair this match with a `this-dir`match.

# Match: sub-dirs-only

Use `sub-dirs-only`to match all directories nested within the current directory, but not the current directory. In most cases, you first declare the directory in a separate `recursive-dirs`match. The exception is when you mean to match on any directory below the root directory. The syntax for this path match is:

```
<match:sub-dirs-only value="Sub-directories Only">
</match:sub-dirs-only>
```

The following metadata example sets revalidation for all files in any subdirectory of the `images`directory, but not the `images`directory itself.

```
<match:recursive-dirs name="images">
    <match:sub-dirs-only" value="Sub-directories Only>
         <revalidate>1046581729</revalidate>
    </match:recursive-dirs>
</match:recursive-dirs>

```

It is also possible, though not recommended, to nest `sub-dirs-only`tags within each other to specify a path that contains no specific component names.

Specifically, you could match any files in directories three levels deep and below, such as these:

```
www.example.com/anydir/anydir2/anydir3/
www.example.com/images/borders/specials/

```

and apply `revalidate`with the following metadata:

```
<match:sub-dirs-only value="Sub-directories Only">
    <match:sub-dirs-only value="Sub-directories Only">
         <match:sub-dirs-only value="Sub-directories Only">
              <revalidate>1046581729</revalidate>
         </match:sub-dirs-only>
    </match:sub-dirs-only>
</match:sub-dirs-only>

```

None of the directory components was specified by name. In this sense, `sub-dirs-only`matches can be interpreted as `*`.

# Match: this-dir

Use `this-dir`to restrict the application of metadata to the current path component.

The syntax for this path match is:

```
<match:this-dir value="This Directory Only">
</match:this-dir>
```

The following metadata example sets revalidation for the `images`directory, but not for any subdirectory of the `images`directory.

```
<match:recursive-dirs value="images">
    <match:this-dir value="This Directory Only">
         <revalidate>1046581729</revalidate>
    </match:this-dir>
</match:recursive-dirs>
```

# Match: filename

To match a specific file within a current directory, use this syntax:

```
<match:filename value=*file.ext* nocase="off">
</match:filename>
```

* The `value`attribute takes a string that is the exact file name to match.

* The `nocase`boolean attribute specifies whether the match is be case-sensitive. By default set to `off`.

The following metadata example matches the `index.html`file in the root directory of a domain.

```
<match:this-dir value="This Directory Only">
    <match:filename value="index.html">
         <revalidate>1046581729</revalidate>
    </match:filename>
</match:this-dir>
```

You can match the default file within the current directory using a special value for the `filename`match:

```
<match:filename value="No File Specified">
</match:filename>
```

`No File Specified`value instructs the edge server to apply the metadata to whatever file the origin server delivers as the default if the directory were accessed without specifying a file. This is handy because not all default files are `.html`.

# Match logic

Make sure you create the match logic carefully. Don't nest URL component matches within any other match type. URL matches must be nested within one another in an unbroken fashion to form the URL path in its proper order. For example, you can't nest a `recursive-dirs` match inside a [cookie](https://techdocs.akamai.com/purge-cache/docs/req-matches) match, because the cookie is not a component of the URL. List the components in the correct order. For example, you can't enclose a `recursive-dirs`match within a `filename`match, because the file name is always last in the URL.

# Sibling pages

* [Revalidate tag](https://techdocs.akamai.com/purge-cache/docs/reval-tag.md)
* [Request matches](https://techdocs.akamai.com/purge-cache/docs/req-matches.md)
* [Response header match](https://techdocs.akamai.com/purge-cache/docs/response-header-match.md)
* [Best practices for multiple requests](https://techdocs.akamai.com/purge-cache/docs/best-practices-multiple-req.md)
* [ECCU request examples](https://techdocs.akamai.com/purge-cache/docs/eccu-req-x.md)