Moving Redirects to the Edge Redirector Cloudlet

by Kirsten Hunter
1829

Many of our customers use Apache or other HTTP servers at their origin, and handle redirects using the configuration on those servers. As Akamai customers, you have the ability to perform those redirects at the edge, reducing the traffic to your origin and improving your users’ experience.

It’s possible to put redirects in place using Property Manager but this can be unwieldy, especially for properties with a large number of redirects. There’s a better way!

The Edge Redirector cloudlet makes it possible to manage your file redirects at the edge using a powerful, flexible and usable interface. The cloudlet system means that you can update those redirects as needed, without publishing a new version of your property to Akamai.

If you’re not already using cloudlets, ask your account team about adding cloudlets to your account so you can take advantage of this powerful capability! If you are a direct Akamai customer, you can add Cloudlets from the marketplace as well.

Once you’ve added cloudlets, you can configure redirects for the Edge Redirector cloudlet in Luna, but this post will give you some guidance on how to create and manage the redirects using the API.

The code and samples for this tutorial can be found in our open source repository at https://github.com/akamai-open/api-kickstart in the examples/python directory.

cloudlet_edge_redirector.py

This simple utility demonstrates the process for setting your redirect policy. It supports creating a new policy (CREATE) or updating the latest policy (LATEST). The code demonstrates the following:

Creation of a new policy when needed:

Creation of appropriate JSON structure (example can be found in rules.json):

Adding the new rule to the policy:

Activating the new policy version:

rules.json

The rules.json file contains an example JSON setup for the rules you wish to set. You will need to create a generator to take your existing configuration for your system and translate it into this format in order to use the code.

Note that this is a very simple example. If you want to add new rules to your existing policy, you’ll pull the existing policy and update it before performing a PUT back to the system.

Categories: Technology

Suggested Article

LEAVE A REPLY