About Conditional Origins

If you're using a Cloudlet that forwards a request to a different origin, you'll likely need to set up Conditional Origins.

An origin is a source of traffic sent from your network to the ​Akamai​ portal. An origin may be a hostname, a data center, or a piece of networking equipment, like a server or a load balancer.

Conditional Origins let you forward a Cloudlets request to a different origin.

In Property Manager, you use these rule templates to set up Conditional Origins:

Property Manager rule templateDescription
Conditional Origin GroupEnables the Conditional Origin feature and provides a container for all the Conditional Origins you want to configure for the property.

It must be the last child rule of the property's default rule.
Conditional Origin DefinitionContains the configuration information for a specific Conditional Origin. By default, it includes an Origin Server behavior and a Content Provider behavior. It must be a child rule of the Conditional Origin Group rule.

You can also add other behaviors to this rule. Any behavior you add to this rule only executes if a Cloudlet selects this Conditional Origin.

Determine how many Conditional Origins you need

Before you start setting up Conditional Origins, you need to know how many you need.

For example, Conditional Origins for Application Load Balancer will likely represent data centers. Hostnames and networking equipment can also be origins.

The Origin Type for a Conditional Origins can be Your Origin, which is a standard customer origin. Once you determine the number of Conditional Origins you need, you can start configuring them.

Optional: Set up CP codes for Conditional Origins

You may want to set up a separate Content Provider (CP) code for your Conditional Origins. You can use this CP code for a blanket purge of the Conditional Origin.

If you wish to track requests using the Conditional Origin this way, you have some options. You can:

  • Add a new CP code for each Conditional Origin
  • Add one CP code to be used by all Conditional Origins
  • Select a CP code used elsewhere in the property
  • Use a separate CP code for quick purge (this option is considered a best practice)

📘

CP code creation is only available for select contracts. If you need a new CP code and do not see the CP code creator, contact your Account Representative to have a CP code made for you.

How to

  1. Access Property Manager configurations associated with the selected ​Akamai Control Center​ account. Go to > CDN > Properties (or just enter Properties in the search box).

    The Property Groups page opens.

  2. Select the property to which you are adding Conditional Origins. The property should be associated with the Cloudlets policy that will use the Conditional Origins.

  3. Select the property version you want to edit.

  4. In the Content Provider Code behavior, click the edit icon in the Content Provider Code field.

  5. Select the Create a new CP Code tab.

  6. If the Create a new CP Code tab is not available, contact your Account Representative to have a CP code made for you. CP code creation is only available for select contracts.

  7. In the CP Code Name field, either accept the default CP code name or enter a new name.

    CP code names can be up to 25 alphanumeric characters, but cannot include spaces or the following characters: underscore ( _ ), comma ( , ), hashtag (#), quotation mark ("), and percent sign (%).

📘

Property Manager automatically populates the CP Code Name field with an entry based on the property's name.

  1. Click Done.

🚧

To avoid a service disruption, do not activate your property on the production network until the system recognizes the new CP code. It may take up to two hours for the ​Akamai​ network to recognize newly-created CP codes. Test on the staging network to verify everything is working as expected.

Set up a Conditional Origin Group rule

The Conditional Origin Group rule is the container for all the Conditional Origins in your property.

When adding this rule, make sure it's the last child rule of the property's default rule. You can't have multiple Conditional Origin Group rules within a property.

  1. Access Property Manager configurations associated with the selected ​Akamai Control Center​ account. Go to > CDN > Properties (or just enter Properties in the search box).

    The Property Groups page opens.

  2. Select the property you're adding Conditional Origins to. The property should be associated with the Cloudlets policy that will use the Conditional Origins.

  3. Select the property version you want to edit. The configuration screen for the selected property version displays.

  4. On the Edit tab, verify that Default Rule is selected and click Add Rule.

    The Add New Rule screen displays.

  5. Select Conditional Origin Group from the list of available rule templates.

    The template description page displays.

  6. Click Insert Rule.

    A new Conditional Origin Group rule displays as the last child rule of the Default Rule.

    By default, this rule template includes child rules for defining two Conditional Origins.

📘

You don't need to set up two Conditional Origins if you only need one. If necessary, you can also delete a Conditional Origin you do not need, or are no longer using.

  1. In the Criteria section for the rule, click Add Match to select the type of match to use to trigger a Conditional Origin. See Property Manager Matches for more information.

  2. In the Allow Conditional Origins behavior, complete the following fields:

FieldDescription
EnableSelect to enable Conditional Origins for this property.
Honor Origin Base PathIf an Origin Base Path behavior is applied to the request, select whether to prefix the path defined in the behavior to the origin path the Cloudlet generates.

If no Origin Base Path behavior is present for the request, this setting has no effect.

Important: If a Cloudlet already modifies the path by prepending the same Origin Base Path, the path segment isn't duplicated.
Origin Purge Query ParameterEnter the query parameter to use when purging cache content from a Conditional Origin. When this query parameter is present in a purge request, the specified Conditional Origin will be purged.

The default query parameter is originId. You define the originId in the Conditional Origin Definition rule.
  1. If an error displays stating that the Conditional Origin Group rule is not the last child rule within the property's Default Rule, go to the rule tree, then click and drag the rule so that it becomes the last rule.

  2. Set up a Conditional Origin Definition rule.

Set up a Conditional Origin Definition rule

Use the Conditional Origin Definition rule to set up the origins to use with your Cloudlet.

This rule must be a child of the Conditional Origin Group rule.

📘

Although this template includes an Origin Server behavior and a Content Provider behavior by default, only the Origin Server behavior is required.

  1. Verify that you have set up a Conditional Origin Group rule.

    By default, the Conditional Origin Group rule includes two Conditional Origin Definition rules.

  2. From the rules pane, click on the first Conditional Origin Definition rule.

  3. In the Criteria section for the rule, specify the Conditional Origin ID.

    The Cloudlets Policy Manager uses this ID when setting the origin for Cloudlets policies. It can contain alphanumeric characters and underscores.

  4. Set up the Origin Server and Content Provider behaviors as needed for the Conditional Origin.

📘

If another rule within the property contains a behavior that modifies the origin, that origin-altering behavior may also be applied to your Conditional Origin.

  1. Add any other behaviors that apply to this new Conditional Origin.

  2. If you want to change the rule name to reflect the function of this Conditional Origin:

    1. On the rules pane, select the Conditional Origin Definition you want to rename.

    2. Click the action cog to the right of the rule name.

    3. Select Edit Name.

    4. Edit the rule name and press Enter.

  3. Click Save.

  4. If you are setting up additional Conditional Origins:

    1. Click on the second Conditional Origin Definition rule.

    2. Repeat steps 4 through 7.

  5. If you need to configure more than two Conditional Origins:

    1. On the Edit tab of the Property Manager configuration, select the Conditional Origin Group rule and click Add Rule.

    2. Select Conditional Origin Definition from the list of available rule templates.

    3. Click Insert Rule.

  6. If you've configured all your Conditional Origins:

    1. Determine whether you need a purge rule for your Conditional Origins.

    2. Activate the property containing the new Conditional Origins.

Optional: Set up a purge rule

Does your property use the Incoming Host Header? If you use this header with Conditional Origins and you're not rewriting any part of the forward path, cache pollution may occur.

To avoid possible cache pollution, set up a Property Manager rule that includes the origin hostname in the cache key. When creating this rule, keep the following in mind:

  • You'll want a separate cache key for each Conditional Origin you're using on that particular property.

  • If you set up cache keys for each Conditional Origin, also configure a separate purge rule. This rule should allow ​Akamai​'s content control mechanisms (CCU/ECCU) to purge the cache key for each of these origins.

  • If you specify a unique CP code for each Conditional Origin, purge all cached content by CP code instead.

  • When setting up a purge rule for Conditional Origins, make sure you add it to the property's default rule.

Activate Conditional Origins in Property Manager

Before you can set up your Cloudlet-specific rules and behavior, you have to activate the property version containing the new Conditional Origins.

  1. Access Property Manager configurations associated with the selected ​Akamai Control Center​ account. Go to > CDN > Properties (or just enter Properties in the search box).

    The Property Groups page opens.

  2. Select the property you've added Conditional Origins to.

  3. On the Property Home screen, find the property version that includes your changes.

  4. Click the gear icon for the configuration version you want to activate.

  5. Select Activate from the drop-down menu.

  6. On the Activate tab, click Activate v# on Network.

📘

You first have to activate the property on the Edge Staging Network (ESN, or Staging) to verify that the Conditional Origins are working as expected. Once you complete testing, you can then activate the property version with the Conditional Origin rules on the ​Akamai​ production network.