# Add a random "PurgeGroup" (PurgeGroup0 to PurgeGroup99)
# Enables purging of CDN cache gradually
if (beresp.http.Surrogate-Key && !std.strstr(beresp.http.Surrogate-Key, "PurgeGroup")) {
set beresp.http.Surrogate-Key = beresp.http.Surrogate-Key " PurgeGroup" randomint(0, 99);
} else if (!beresp.http.Surrogate-Key) {
set beresp.http.Surrogate-Key = "PurgeGroup" randomint(0, 99);
}