All Products
Search
Document Center

Edge Security Acceleration:Query string

Last Updated:Sep 19, 2024

You can specify whether POPs ignore the question mark (?) and the query string that follows the question mark (?) in a request URL before cache keys are generated. The query string includes information such as user identity and originating IP addresses. This increases the cache hit ratio and accelerates page loading.

Feature description

Description

Scenario

If you configure to ignore the question mark (?) and parameters after the question mark (?) in a request URL, all user requests for the same file, regardless of their different query parameters, are served with the same cached file. This improves the cache hit ratio, reduces the number of origin requests, and accelerates content distribution.

When users access a resource on ESA POPs, they may include parameters after the question mark (?) in request URLs to convey information such as user identity and originating IP addresses. This makes different clients use different parameters even when they are requesting the same resource.

If parameters included after the question mark (?) in request URLs are not related to the requested resource, we recommend that you configure to ignore the query string. Example:

  • Request from User A: http://example.com/1.jpg?uid=123***

  • Request from User B: http://example.com/1.jpg?uid=654***

If POPs directly handle the requests without ignoring query strings, they cannot serve the same cached file. Instead, each request goes to the origin server to fetch the resource.

After you configure to ignore query strings in request URLs, POPs serve content only based on http://example.com/1.jpg, disregarding any appended query parameters.

Procedure

  1. Log on to the ESA console.

  2. In the left-side navigation pane, click Websites.

  3. On the Websites page, find the website that you want to manage, and click the website name or View Details in the Actions column.

  4. In the left-side navigation tree, choose Caching > Settings.

  5. In the Query Strings section, click Configure. Select an option and complete the setting as prompted.

    image

    The following table takes http://example.com/1.jpg?key1=1&key2=2&key3=3 as an example to shows how different options affect the generated cache keys.

  6. Parameter

    Operation

    Example

    Ignore All

    Ignores the question mark (?) and the query string after the question mark (?) in the request URL.

    The cache key is http://example.com/1.jpg.

    Retain All

    Retains the question mark (?) and the query string that follows the question mark (?) in the request URL.

    The cache key is http://example.com/1.jpg?key1=1&key2=2&key3=3.

    Ignore Specific Parameters

    Ignores specific parameters in the query string after the question mark (?) in the request URL. Type the parameters that you want to ignore in the field below, and press Enter for each entry.

    If the parameters that you want to ignore are key1=1 and key3=3, the cache key is http://example.com/1.jpg?key2=2.

    Retain Specific Parameters

    Retains specific parameters in the query string after the question mark (?) in the request URL. Type the parameters that you want to retain in the field below, and press Enter for each entry.

    If the parameters that you want to retain are key1=1 and key3=3, the cache key is http://example.com/1.jpg?key1=1&key3=3.

  7. Click OK.