I came across a use case to redirect the traffic from AEM Fastly based on uri, with the very limited access to Fastly, it seems not possible and setting up a new CDN for only redirect use case doesn't seem logical.
Need your inputs if anyone come across this use case? I want to avoid the redirects at dispatcher level to reduce latency due to the performance is key for the sites.
Views
Replies
Total Likes
Hi,
you can contact Adobe, if you are using Adobe's CDN.
Does Adobe have additional privileges to add redirects rules at Fastly level as these seems not exposed to us.
Have you already tried to send a 302 with a TTL, so it can be cached?
@vicky5677 Try using VCL snippets: VCL snippets are small pieces of code that can be inserted into Fastly's configuration to add custom functionality. This is a more efficient way to handle redirects than doing it at the dispatcher level because VCL snippets are executed at the edge of the network, which means that they can be cached.
To redirect traffic from AEM Fastly based on URI using VCL snippets, you will need to create a dataset of redirects as a VCL table. This table should contain the following columns:
Here is an example of a VCL snippet that can be used to redirect traffic from /old-uri
to /new-uri
:
bereq.uri ~ "^/old-uri$" {
rewrite "/new-uri" 301;
}
This snippet will match any request that starts with /old-uri
and rewrite it to /new-uri
. The 301
status code indicates that the redirect is permanent.
Views
Replies
Total Likes
Views
Likes
Replies