Hi @bhavigoyal
Yes, it is possible to set traffic filter rules, including rate limits, in AEM as a Cloud OOTB Fastly CDN. Some of the advanced WAF-based rules require an additional WAF or advanced security license, but the basic filter rules can be used OOTB.
You can create VCL snippets for the recv subroutine with the following VCL code:
if (req.url.path !~ "/media_[0-9a-f]{40,}[/a-zA-Z0-9_-]*\.[0-9a-z]+$"
&& req.url.ext !~ "(?i)^(gif|png|jpe?g|webp)$"
&& req.url.ext != "json"
&& req.url.path != "/.auth") {
// strip query string from request url
set req.url = req.url.path;
}
if (req.url.path !~ "/media_[0-9a-f]{40,}[/a-zA-Z0-9_-]*\.[0-9a-z]+$"
&& req.url.ext !~ "(?i)^(gif|png|jpe?g|webp)$"
&& req.url.ext != "json"
&& req.url.path != "/.auth") {
// strip query string from request url
set req.url = req.url.path;
}
set bereq.http.X-BYO-CDN-Type = "fastly";
set bereq.http.X-Push-Invalidation = "enabled";
This code enables the push invalidation including long cache TTLs.
You can also create a deliver snippet with the following VCL code:
unset resp.http.Age;
if (req.url.path !~ "\.plain\.html$") {
unset resp.http.X-Robots-Tag;
}
https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/edge-delivery/launch/byo-cdn-fastly-setup