Manual Chapter : Serving Specific Hyperlinked Content with Parameter Value Substitution

Applies To:

Show Versions Show Versions

BIG-IP AAM

  • 14.1.3, 14.1.2, 14.1.0, 14.0.1, 14.0.0, 13.1.5, 13.1.4, 13.1.3, 13.1.1, 13.1.0, 13.0.1, 13.0.0
Manual Chapter

Overview: Serving specific hyperlinked content with parameter value substitution

You can use parameter value substitution functionality to change a targeted parameter's value on a specific page serviced from cache, so that the client-specified parameter appears on the URL embedded in the page. This substitution is especially beneficial when a query parameter contains identification information for a site's visitors.

Some requested pages include hyperlinks that vary according to the request to provide dynamic information. For example, you can configure parameter value substitution so that a request with a query parameter called shopper produces HTML output with its embedded hyperlinks varying the value for shopper. Thus, when a query parameter contains identification information for a site's visitors, it prompts the BIG-IP® device to serve different content for the request, based on the specific visitor.

Conversely, if parameter value substitution is not configured, the BIG-IP device uses the value that it cached for the original request, for all subsequent requests after the first, even if the subsequent requests have different values that the origin web server used in the response.

About configuring value substitution parameters for an assembly rule

When you configure parameter value substitution, you specify a source definition and a target definition. You also have the option to provide a URL prefix for the target, to limit the URLs to which the BIG-IP® device performs the substitution.

Source definition

When you define a source definition, you specify the source of the value that you want the BIG-IP device to embed in the URL, in place of the cached (target) value. Typically, the source is a certain request element, such as a query parameter. However, you can define another source type, such as a random number, by using number randomizer. When you define the source, you identify the parameter by data type and name or location in the request.

If you use the request URL as the source, the BIG-IP device uses the entire absolute or relative request URL as the value to substitute.

Target definition

A target definition specifies the element in a URL that is replaced with the value from the source definition. The target is a specific element in the URL, such as a particular query parameter, the value for which the BIG-IP device replaces during substitution. When you define the target, you identify the parameter by data type and name or location in the URL, for example, by using a query parameter, an unnamed query parameter, or a path segment.

Although you can specify the same request element for both the source and the target, the parameter specified for the source is located in the request URL and the parameter specified for the target is located in the embedded URL in the cached page.

By default, the BIG-IP device performs substitution on all embedded URLs in which the identified target appears. You have the option to limit which URLs embedded in a page are targeted for substitution by specifying a prefix that an embedded URL must match before the BIG-IP device performs substitution.

Example: Substitution of request URL with target URL

The BIG-IP device substitutes the request URL with the target URL, including it as the url query parameter in the embedded URL of the cached page.

In this example, the following request URL is used as a source definition: http://www.siterequest.com/apps/something.jsp?entity=orange.

The request URL is then substituted with the following target URL: <a href="http://www.siterequest.com/anotherthing.jsp? url=http://www.siterequest.com/apps/something.jsp? entity=orange&....">

About using number randomizer for parameter value substitution

When configured, the assembly rule's number randomizer setting generates a random number and places it in a targeted location in the embedded URL. When the BIG-IP® device compiles the response, it examines the target location to see the length of the string used for the value. On subsequent page requests, the BIG-IP replaces that value with a random number of the same length.

This setting is generally used for sites that use an Internet advertisement agency, which requires random numbers to be placed on URLs that request ads as a way to interrupt traditional caches. By requiring a random number, Internet advertisement agencies force this traffic to their site.

For example, consider a cached page that includes the following embedded URL:

  • <a href src=”http://www.siterequest.com/getAd?entity=45&...”> </a>

You can configure random value substitution so that the BIG-IP sets random values set for the entity query parameter for subsequent pages as follows:

  • <a href src=”http://www.siterequest.com/getAd?entity=45&...”> </a>
  • <a href src=”http://www.siterequest.com/getAd?entity=11&...”> </a>
  • <a href src=”http://www.siterequest.com/getAd?entity=87&...”> </a>

A parameter value substitution example

The following examples show requests with and without parameter value substitution.

An example without parameter value substitution

This example describes a standard sequence without parameter value substitution to serve a cached page.

An original request generates a cached page.

Original page request

http://www.siterequest.com/apps/shopping.jsp? shopper=AAnb35vnM09&.... URL in cached page <a href="http://www.siterequest.com/apps/shopping.jsp? shopper=AAnb35vnM09&...."link</a>

For subsequent requests of the example page, the BIG-IP® system still serves the cached page.

Subsequent request

http://www.siterequest.com/apps/shopping.jsp? shopper=SNkj90qcL47&....

URL in cached page

<a href="http://www.siterequest.com/apps/shopping.jsp? shopper=AAnb35vnM09&...."link</a>

Because parameter value substitution is not defined, the BIG-IP continues to serve the cached page for subsequent requests.

An example with parameter value substitution

If you configure parameter value substitution for an assembly rule, the BIG-IP changes the targeted parameter's value on the page that it serves from cache, so that the parameter you specify appears on the URL embedded in that page.

When you use parameter value substitution in assembly rules, you identify the value as a dynamic source definition in an HTTP request or number randomizer, and specify that when the BIG-IP serves the page, it embeds the named value into the appropriate location in the page's URL.

Therefore, for the example URL, when you define a parameter value substitution, the BIG-IP substitutes the original cached value for the shopper attribute with the value in the request.

An original request generates a cached page.

Request Request URL BIG-IP embedded URL in cached page
Original request http://www.siterequest.com/apps/shopping.jsp? shopper=AAnb35vnM09&.... <a href="http://www.siterequest.com/apps/shoppingCart.jsp? shopper=AAnb35vnM09&...."link</a>

For subsequent requests of the example page, the BIG-IP substitutes the original cached value for the shopper attribute, replacing it with the value in the request.

Request Request URL BIG-IP embedded URL in cached page
Subsequent request http://www.siterequest.com/apps/shopping.jsp? shopper=SNkj90qcL47&.... <a href="http://www.siterequest.com/apps/shoppingCart.jsp? shopper=SNkj90qcL47&...."link</a>

When parameter value substitution is defined, the BIG-IP substitutes the original cached value with the value from the requested page for subsequent requests, providing the ability to serve the appropriate specific content.