Best practices for multiple requests

Learn about the match constraints and most efficient ways to build complex request files.

Use spaces to separate values

The number of ECCU revalidation requests you can include in the configuration for a single host header is limited to keep the invalidations from piling up endlessly. Submitting more than 250 invalidation requests at one time can result in a global invalidation, that is a revalidation of all content for that host header.

To avoid this, try to invalidate multiple objects or paths in one request. Use multiple, space-separated values for matches. Since each value is evaluated separately in only one request, this is a more effective way to submit requests.

Here's a sample match using multiple values separated by spaces:

The right way...

<match:recursive-dirs value="dir_1 dir_2 dir_3">
    <revalidate>now</revalidate>
</match:recursive-dirs>

The wrong way...

<match:recursive-dirs value="dir_1">
     <revalidate>now</revalidate>
</match:recursive-dirs>
<match:recursive-dirs value="dir_2">
     <revalidate>now</revalidate>
</match:recursive-dirs>
<match:recursive-dirs value="dir_3">
     <revalidate>now</revalidate>
</match:recursive-dirs>

Multiple levels, multiple matches

Multiple matches can be applied to multiple levels. For example, to invalidate an endpoint name in multiple trees, you can enclose the intermediate names in a single match:

<match:recursive-dirs value="top_dir">
    <match:recursive-dirs value="mid_dir_1 mid_dir_2 mid_dir_3">
         <match:recursive-dirs value="end_dir">
              <revalidate>now</revalidate>
         </match:recursive-dirs>
    </match:recursive-dirs>
</match:recursive-dirs

This one request below can replace 12 individually built requests:

<match:recursive-dirs value="top_dir">
    <match:recursive-dirs value="mid_dir_1 mid_dir_2 mid_dir_3">
         <match:recursive-dirs value="end_dir_1 end_dir_2 end_dir_3 end_dir_4">
              <revalidate>now</revalidate>
         </match:recursive-dirs>
    </match:recursive-dirs>
</match:recursive-dirs