CDN: Forward to a different resource instead of redirect

1.9k Views Asked by At

I need to send different resources (specially images) for same urls depending on a complex logic based on different factors (cookie, IP, time, random). I want to take advantage of CDNs (cache, availability, proximity). So, I want this CDN to make a call to my server in order to decide which resource serve to any request. It is very important to not use redirects, so the user will never see a 30X status code.

For clarification:

Is it possible using any current commercial solution?

2

There are 2 best solutions below

0
Gea-Suan Lin On

Yes, I think it is already supported by CDNetworks long time ago.

It is called "Origin Logic Control" now. You can check the description from http://www.cdnetworks.com/wp-content/uploads/2013/08/CDNetworks-ContentAccel-DS-EN2.pdf:

Allows a customer’s domain to require checking with the origin on every request.

You can return a special HTTP header (or special HTTP body, I am not sure now) to tell CDNetworks to return resources directly (and using cached version if available), not 30x status code.

0
Eric On

You can enable Redirect Chasing to get what you are looking for. Alternatively, look at the Akamai blog post on Edge Redirect for a faster option.