Best Practices in Requests: Use Space-Separated Values

The number of ECCU revalidate requests that can be included 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” –revalidating all content for that host header.

The way to avoid this is to invalidate multiple objects or paths in one request. You do this by using 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 an example 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 “end- point name” in multiple trees, enclose the intermediate names in a single match.

This is valid:

<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 would 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