CDNetworks Documentation Console Guide HTTP Protocol Optimization

HTTP Protocol Optimization

Last update:2022-06-28 15:35:41

•Entrance
Product → Configuration → Edit Configuration → HTTP Protocol Optimization

•Introduction
With this configuration, there are six functions for HTTP Protocol Optimization

  1. Redirection Optimization : when origin responds to HTTP status code 301 or 302, the system will redirect the requests to another origin to get objects, rather than sending the HTTP status code to users.
  2. Error Page Redirection : Set the error page returned when origin server respond HTTP code 403/404/500/502/503/504
  3. HTTP Header : Add/Replace/Remove different HTTP headers.
  4. HTTP Setting 2.0 : Turn on/off HTTP 2.0 (h2). default value is to turn off HTTP 2.0
  5. Websocket : Turn on/off websocket. default value is to turn off websocket
  6. URL Rewrite : Create rules to redirect or rewrite the URLs that your end-users’ requests

Tips. when you see the each configuration menu , you can see table layout is as below at each function.

image.png

when you see all config rules with Main Configuration and Secondary Configuration, you can understand config rules for each functions. (eg, HTTP header, Cache Optimization and others)

  1. Main Configuration : for example, in HTTP header configuration menu, you think HTTP header rule as main config rules.

  2. Secondary Configuration : the element displays other config rules except config rule of Main Configuration

  3. Review Config-rule : you can read the config rule as below snapshot
    image.png

  4. Edit Config-rule : you can edit the config rule.
    if edit button is not displayed, it means that there is no permission to edit the rule by customer-self,
    when you want to edit that , please contact CDNetworks technical staff.

  5. Remove Config-rule : you can remove the config rule when you agree “OK” at the below dialog box
    image.png

1 Redirection Optimization

•Entrance
Product → Configuration → Edit Configuration → HTTP Protocol Optimization → Redirection Optimization

•Introduction
This function is to redirect the requests to another origin to get objects, when origin responds to HTTP status code 301 or 302. and to reduce the client redirect about HTTP status 301,302
at default, not configured.

•Guides for operations
The following page is for configurations with many selections on the left menu, ‘HTTP Protocol Optimization’ included. Click modify to configure the function as you want, then click next.

image.png

image.png

in the Confirm Modification page, You need to confirm all of the information that you have change, then choose Pre-deployment or Deploy Now for the next step which will take 3 to 5 minutes.

•Examples

Assume that the ‘URL rewrite’ at the ‘Redirection Optimization’ for following snapshot is configured as below
image.png

CDN nodes redirect the requests to another origin to get objects, rather than sending the HTTP status code to users when origin responds to HTTP status code 301 or 302

2Error Page Redirection

•Entrance
Product → Configuration → Edit Configuration → HTTP Protocol Optimization → Error Page Redirection

•Introduction
This function is to create a rule to respond to any pages as you set when origins occurred an error.

•Guides for operations
The following page is for configurations with many selections on the left menu, ‘HTTP Protocol Optimization’ with ‘Error Page Redirection’ configurations included. A window will pop up when you click add, then click next after all column haven been filled.

image.png

image.png

image.png
You need to confirm all of the information that you have changed, then choose Pre-deployment or Deploy Now for next step which will take 3 to 5 minutes.

•Examples
Assume that a domain was configured as below.
image.png

User request will be redirected to http://www.11.com, when the status code from origins is 500.

3.HTTP Header

•Entrance
Product → Configuration → Edit Configuration → HTTP Protocol Optimization → HTTP header

•Introduction
This function is to add/replace/remove different HTTP headers for provide additional information with an HTTP request or HTTP response between client and origin.
When you want more information. Please contact your assigned technical support for help.

•Guides for operations
The following page is for configurations with many selections on the left menu, ‘HTTP Protocol Optimization’ with ‘HTTP Header’ configurations included. A window will pop up when you click add, then click next after all column haven been filled.
image.png

This function is use for managing HTTP Header. Such as ‘Specified General Type’, ‘File Type’, ‘Special URL’ ,‘Directory’ and ‘URL Pattern’.

•'File Type': You can choose some file types already exist, even create some customized types. Files within scope you defined will be affected by this policy.
•'Special URL': You can create policies with specific URLs.
•'Directory': Files in these directories you configured will be cached as policy definition.
•'URL Pattern': You can create policies with specific URL patterns.

The intersection of all configuration will be add/replace/deleted by the policy with highest priority. Priority is shown by numbers, the higher number, the higher priority.

With this configuration, there are several configuration parameters to add/replace/delete HTTP header.

  1. Operation type : Define action of Adding/Replacing/Deleting HTTP Header(s).

  2. HTTP Header : Specify the HTTP header to add / replace / delete. Here are 9 common HTTP headers for selection.
    Expires, Content-Type, Content-Language, Content-Disposition, Cache-Control, Access-Control-Max-Age, Access-Control-Expose-Headers, Access-Control-Allow-Origin, Access-Control-Allow-Methods
    When the operation type is add or replace, the HTTP header or custom HTTP header can only have one header.

  3. Control-Direction : Configure error-status code based caching rules for response status codes (204, 305, 40x, 50x) by user-defined cache-time.

  4. New Value : When the operation type is Add/replace, this is used to enter the value of the HTTP header.

( When you want more information. Please contact your assigned technical support of CDNetworks for help )
image.png

You need to confirm all of the information that you have changed, then choose Pre-deployment or Deploy Now for next step which will take 3 to 5 minutes.

• Examples
Assume that a domain was configured as below.

image.png
As Customize HTTP Header : Customize is added. CDN nodes ask the requests to the origin to get objects with X-Validated-Header and its value is PWS/8.3.1.0.8.

4 HTTP 2.0 Setting

•Entrance
Product → Configuration → Edit Configuration → HTTP Protocol Optimization → HTTP 2.0 Setting

•Introduction
This function is to turn on/off HTTP 2.0 (h2). default value is to turn off HTTP 2.0

•Guides for operations
The following page is for configurations with many selections on the left menu, ‘HTTP Protocol Optimization’ with ‘HTTP 2.0 Setting’ configurations included. A window will pop up when you click add, then click next after all column haven been filled.
image.png
image.png

You need to confirm all of the information that you have changed, then choose Pre-deployment or Deploy Now for next step which will take 3 to 5 minutes.

•Examples
Assume that a domain was configured as below.
image.png

As HTTP 2.0 Setting is turned on. CDN nodes ask the requests to get objects with change beween end-users and CDN nodes

5 Websocket

•Entrance
Product → Configuration → Edit Configuration → HTTP Protocol Optimization → Websocket

•Introduction
This function is to turn on/off websocket.
default value is to turn off websocket

•Guides for operations
The following page is for configurations with many selections on the left menu, ‘HTTP Protocol Optimization’ with ‘Websocket’ configurations included. A window will pop up when you click add, then click next after all column haven been filled.
image.png
image.png

You need to confirm all of the information that you have changed, then choose Pre-deployment or Deploy Now for next step which will take 3 to 5 minutes.

• Examples
Assume that a domain was configured as below.
image.png
As Websocket Status is turned on, CDN nodes can ask the requests to the origin to get objects via websocket.

6 URL Rewrite

• Entrance
Product → Configuration → Edit Configuration → HTTP Protocol Optimization → URL Rewrite

• Introduction
With this configuration, the URL Rewrite lets you create rules to redirect or rewrite the URLs that your end-users’ requests

• Guides for operations

The following page is for configurations with many selections on the left menu, ‘URL Rewrite’ included. Fill the column of URL Rewrite Patten as you want, then click next.
image2021511_112425.png
image2021511_112526.png
image2021511_112545.png
image2021511_113049.png

in the Confirm Modification page, You need to confirm all of the information that you have change, then choose Pre-deployment or Deploy Now for the next step which will take 3 to 5 minutes.
image2021511_113231.png

• Examples
Assume that a domain was configured as below:
Assume that the ‘Client Redirection’ at the ‘Redirect Optimization’ for following snapshot is configured as below

image20201111_155039.png

When CDN nodes have no caches for requests with URL pattern “.*.(svg$|png$|jpeg$|jpg$|gif$)” , they will get objects by going to origins with HTTP Status code 302 and change protocol from HTTP to HTTPS . Then these objects will be cached on CDN nodes.

Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!