07-Layer 3—IP Services Configuration Guide

HomeSupportConfigure & DeployConfiguration GuidesH3C MSR1000[2600][3600] Routers Configuration Guides(V9)-R9119-6W10007-Layer 3—IP Services Configuration Guide
23-Web caching configuration
Title Size Download
23-Web caching configuration 214.45 KB

Configuring Web caching

About Web caching

The Web caching feature saves specific webpage content requested by HTTP or HTTPS users from specific Web servers to files in the Web cache directory. If users access the same content before the content is aged out, the device retrieves the content from the files and sends the content to the users. Web caching can reduce the traffic between the device and the Web servers, lower Web content transmission costs, relieve pressure on Web servers, and improve user Web access speed.

Basic concepts

·     Web cache files and Web cache directory—The Web caching feature saves its operation data and the Web content to be cached to files in the Web cache directory. After the effective maximum total size for Web cache files is reached, the device deletes the oldest Web cache file to save the new Web cache file.

·     Web cache file aging time—The Web cache file aging time is fixed at 30 days. When the device reboots or receives a request for the cached content in a file, it restarts the aging timer. If no users request the cached content before the aging timer expires, the device deletes the file.

Web caching mechanism

Figure 1 shows the Web caching mechanism.

Figure 1 Web caching mechanism

 

1.     The host sends an HTTP or HTTPS GET request to the device.

2.     The device identifies whether the destination port number in the request is the same as the listening port number used by the Web server. If yes, the device replaces the destination port number with the listening port number specified for Web caching to trigger the Web caching process.

3.     The Web caching process obtains the URL of the request and looks up its cache for the requested content.

¡     If the requested content is found in the cache, the device retrieves the content and sends the content to the host. The HTTP or HTTPS GET operation is completed.

¡     If the requested content is not found, the device re-constructs the request and sends the request to the Web server.

4.     The Web server sends the requested content to the device.

5.     The device identifies whether the Web caching feature is configured to cache the content.

¡     If yes, the device uses the Web caching feature to cache the content, re-constructs a response, and sends the response to the host.

¡     If not, the device re-constructs a response and sends the response to the host.

Before sending the response, the device will check whether the source port number is the same as the listening port number used by Web caching. If not, the device will replace the source port number in the response with the listening port number of the Web server.

Web caching backup

The Web cache backup feature enhances the high availability of the Web caching service. You can specify a primary slot and a backup slot for Web caching. When the primary slot fails, the backup slot will take over to provide the Web caching service to ensure service continuity. When the primary slot recovers, the Web caching service switches back to the primary slot.

Restrictions: Hardware compatibility with Web caching

Hardware

Feature compatibility

MSR810, MSR810-W, MSR810-W-DB, MSR810-LM, MSR810-W-LM, MSR810-10-PoE, MSR810-LM-HK, MSR810-W-LM-HK, MSR810-LM-CNDE-SJK, MSR810-CNDE-SJK

Yes

MSR810-LMS, MSR810-LUS

No

MSR810-LMS-EA, MSR810-LME

Yes

MSR1004S-5G

Yes

MSR2600-6-X1, MSR2600-10-X1, MSR2600-15-X1

Yes

MSR 2630

Yes

MSR3600-28, MSR3600-51

Yes

MSR3600-28-SI, MSR3600-51-SI

No

MSR3600-28-X1, MSR3600-28-X1-DP, MSR3600-51-X1, MSR3600-51-X1-DP

Yes

MSR3610-I-DP, MSR3610-IE-DP, MSR3610-IE-ES, MSR3610-IE-EAD, MSR-EAD-AK770, MSR3610-I-IG, MSR3610-IE-IG

Yes

MSR3610-X1, MSR3610-X1-DP, MSR3610-X1-DC, MSR3610-X1-DP-DC

Yes

MSR 3610, MSR 3620, MSR 3620-DP, MSR 3640, MSR 3660

Yes

MSR3610-G, MSR3620-G

Yes

Hardware

Feature compatibility

MSR810-W-WiNet, MSR810-LM-WiNet

Yes

MSR830-4LM-WiNet

Yes

MSR830-5BEI-WiNet, MSR830-6EI-WiNet, MSR830-10BEI-WiNet

Yes

MSR830-6BHI-WiNet, MSR830-10BHI-WiNet

Yes

MSR2600-6-WiNet, MSR2600-10-X1-WiNet

Yes

MSR2630-WiNet

Yes

MSR3600-28-WiNet

Yes

MSR3610-X1-WiNet

Yes

MSR3610-WiNet, MSR3620-10-WiNet, MSR3620-DP-WiNet, MSR3620-WiNet, MSR3660-WiNet

Yes

Hardware

Feature compatibility

MSR2630-XS

Yes

MSR3600-28-XS

Yes

MSR3610-XS

Yes

MSR3620-XS

Yes

MSR3610-I-XS

Yes

MSR3610-IE-XS

Yes

Hardware

Feature compatibility

MSR810-LM-GL

Yes

MSR810-W-LM-GL

Yes

MSR830-6EI-GL

Yes

MSR830-10EI-GL

Yes

MSR830-6HI-GL

Yes

MSR830-10HI-GL

Yes

MSR1004S-5G-GL

Yes

MSR2600-6-X1-GL

Yes

MSR3600-28-SI-GL

No

License requirement for Web caching

The Web caching feature requires a license. If you configure the feature without a license, the settings will be lost after a device reboot. For information about feature licensing, see Fundamentals Configuration Guide.

Restrictions and guidelines: Web caching configuration

Before configuring or modifying Web caching parameters, you must disable Web caching. After configuring or modifying Web caching parameters, enable Web caching again.

Web caching tasks at a glance

To configure Web caching, perform the following tasks:

1.     Configuring webpage file filtering

2.     (Optional.) Configuring Web client and server filtering

3.     Specifying listening port numbers

4.     Configuring Web cache file storage parameters

5.     Configuring traffic direction channels for Web cache dual gateways

6.     Enabling Web caching

7.     (Optional.) Configuring Web caching backup

Configuring webpage file filtering

About this task

Perform this task to filter webpage files to be cached. Web caching supports filtering webpage files by file name, file type, and file extension.

You must specify a type of files to be cached so that Web cache will cache Web resources.

If you configure filtering criteria file name, file type, and file extension, a webpage file that matches any of the filtering criteria will be cached. During filtering, the criterion file name is firstly used.

Prerequisites

Before configuring or modifying webpage file filtering settings, you must disable Web caching. After configuring or modifying webpage file filtering settings, enable Web caching again.

Procedure

1.     Enter system view.

system-view

2.     Create and enter Web cache view.

In standalone mode:

web-cache

In IRF mode:

web-cache slot slot-number

3.     Specify the types of webpage files to be cached.

cached-data { apk | bmp | doc | docx | gif | gzip | ipa | jar | jpg | jpeg | mp4 | pdf | png | ppt | pptx | rar | swf | tar | txt | xls | xlsx | zip } *

By default, no webpage file types are specified. The Web caching feature does not cache any types of files on webpages.

4.     (Optional.) Specify webpage files to be cached.

cached-file file-name

By default, no webpage files to be cached are specified.

5.     (Optional.) Specify a file extension of webpage files to be cached.

cached-extension-name extension-name

By default, no file extensions are specified.

You can execute this command multiple times to specify multiple file extensions. A maximum of 64 file extensions are supported.

Configuring Web client and server filtering

About this feature

By default, Web caching caches webpage content from all Web servers. You can perform this task to configure Web caching to cache only Web content requested by Web clients or sent from Web servers specified by an object group.

Restrictions and guidelines

Make sure the object group used is an existing object group. Otherwise, Web caching will not cache any Web content.

Prerequisites

Before you configure Web client and server filtering, you must complete the following tasks:

·     Configure an IPv4 address object group. For more information about the IP address object group feature, see object group configuration in Security Configuration Guide.

·     Disable HTTP-based Web caching. After you complete the configuration, enable Web caching again.

Procedure

1.     Enter system view.

system-view

2.     Create and enter Web cache view.

In standalone mode:

web-cache

In IRF mode:

web-cache slot slot-number

3.     Specify an IP address object group used to filter Web content to be cached.

object-group [ source ] { ip | ipv6 } object-group-name

By default, no IP address object group is specified for the Web caching feature to filter Web content. The Web caching feature caches Web content from all Web servers.

Specifying listening port numbers

About this task

By default:

·     For HTTP, Web caching listens for HTTP packets on port number 80 and caches Web resources from Web servers that use 80 as the HTTP listening port number.

·     For HTTPS, Web caching listens for HTTPS packets on port number 443 and caches Web resources from Web servers that use 443 as the HTTPS listening port number.

Perform this task in either of the following situations:

·     A port number used by Web caching to listen for HTTP or HTTPS packets is used by another service on the device, which causes Web caching fails to be enabled.

·     A Web server does not listen for HTTP packets on port number 80 or HTTPS packets on port number 443.

Restrictions and guidelines

If Web caching caches webpage files from multiple Web servers that use different listening port numbers, you must configure multiple listening port number pairs for the Web servers. A listening port number for Web caching and a listening port number for a Web server is a listening port number pair.

For each protocol (HTTP or HTTPS), you can specify a maximum of eight listening port number pairs.

If a TCP port number has been specified as an HTTP listening port number, you cannot specify it as an HTTPS listening port number, and vice versa.

Prerequisites

Before you specify listening port numbers, you must complete the following tasks:

·     Configure an IPv4 address object group. For more information about  the IP address object group feature, see object group configuration in Security Configuration Guide.

·     Disable HTTP-based Web caching. After you complete the configuration, enable Web caching again.

Procedure

1.     Enter system view.

system-view

2.     Enter Web cache view.

In standalone mode:

web-cache

In IRF mode:

web-cache slot slot-number

3.     Specify listening port numbers.

¡     Specify HTTP listening port numbers.

listen-port port-number [ server-port server-port-number ]

¡     Specify HTTPS listening port numbers.

https listen-port port-number [ server-port server-port-number ]

Configuring Web cache file storage parameters

About this task

Perform this task to specify the primary Web cache directory or limit the total size of Web cache files.

Restrictions and guidelines

The Web cache directory for a Web cache view must reside on the same slot as the Web view.

Before specifying a Web cache directory, make sure all files in the upper-level directory are using a different name than the Web cache directory or have a file extension.

Make sure the storage medium where the Web cache directory resides has sufficient storage space. The directory typically needs a storage space of over 1 GB.

Prerequisites

Before you configuring Web cache file storage parameters, disable Web caching. After you complete the configuration, enable Web caching again.

Procedure

1.     Enter system view.

system-view

2.     Enter Web cache view.

In standalone mode:

web-cache

In IRF mode:

web-cache slot slot-number

3.     Set the primary Web cache directory.

file-directory directory

By default, the primary Web cache directory is not set.

4.     (Optional.) Set the maximum total size of Web cache files.

cache-limit size

By default, the maximum total size of Web cache files is 4 GB.

The maximum total size for Web cache files must be smaller than the maximum storage space size in the working directory.

Configuring traffic direction channels for Web cache dual gateways

About this task

Perform this task in the Web Cache dual gateways scenario. As shown in Figure 2, gateways Device A and Device B provide the Web Cache service for the user through the switch, and equal cost paths exist on both the uplink and downlink for Web cache. If the uplink and downlink traffic forwarding paths are not the same, the uplink traffic and downlink traffic will be forwarded to different gateways for processing, for example, the user uplink traffic passes Device A and the downlink traffic for the user passes Device B. Device B does not have a record for the user and therefore cannot forward the downlink traffic to the user and the user cannot access the requested Web resources as a result.

 

 

NOTE:

In the Web cache dual gateway scenario, the uplink traffic refers to the HTTP/HTTPS requests sent from user hosts to Web servers, and the downlink traffic refers to the HTTP/HTTP responses sent from Web servers to user hosts. The traffic direction channel between the gateway devices is a direct physical link or a GRE tunnel, which ensures the IP connectivity between the gateways.

Figure 2 User failure to access Web resources

As shown in Figure 3, on Device B, you can configure a traffic direction channel with the peer gateway (Device A). If Device B receives Web cache downlink traffic for a user that it cannot find, it forwards the downlink traffic to the peer gateway through the specified channel interface, so the peer gateway can provide Web resources for the user correctly.

Figure 3 Traffic direction channel between gateways

Restrictions and guidelines

When you execute the dual-gateway-channel command, make sure the specified IPv4 address of the peer gateway is reachable, and in the routing table, the outgoing interface for this IPv4 address is the channel interface specified in this command.

You can use the dual-gateway-channel command to configure multiple traffic direction channels in multiple VPN instances. If you execute this command for the same VPN instance or for the public network multiple times, the most recent configuration takes effect.

Prerequisites

Before you configure a channel for traffic direction with the peer gateway, complete the following tasks:

·     Establish the channel between the gateways to ensure that the downlink traffic can be sent to the peer gateway through the channel.

·     Disable the Web cache feature.

After you configure the channel, enable the Web cache feature again.

Procedure

1.     Enter system view.

system-view

2.     Create a Web cache and enter its view.

In standalone mode:

web-cache

In IRF mode:

web-cache slot slot-number

3.     Configure a channel for traffic direction with the peer gateway.

dual-gateway-channel [ vpn-instance vpn-instance-name ] interface interface-type interface-number peer ipv4-address

Enabling Web caching

Restrictions and guidelines

Before enabling Web caching, you must configure the types of the webpage files to be cached and the primary Web cache directory.

Web caching will restart in one of the following situations:

·     When HTTP-based Web caching is configured, enable HTTPS-based Web caching.

·     When HTTPS-based Web caching is configured, enable HTTP-based Web caching.

·     When both HTTP-based and HTTPS-based Web caching are configured, disable HTTP-based or HTTPS-based Web caching.

When the device enabled with HTTPS-based Web caching attempts to cache Web resources accessed by a user through HTTPS, the user will be prompted with a certificate warning. Because the certificate of the device is a private CA-issued digital certificate, it cannot pass the verification of the user host. To resolve this issue, the user can export the device's CA root certificate file (webcache_cacert.crt) from the Web caching working directory and import it to the trusted certificate authorities store. Then, the device' certificate can pass the verification of the user host so the user will not be prompted with the certificate warning.

Procedure

1.     Enter system view.

system-view

2.     Enter Web cache view.

In standalone mode:

web-cache

In IRF mode:

web-cache slot slot-number

3.     Enable Web caching. Choose the options to configure as needed:

¡     Enable HTTP-based Web caching.

http enable

By default, HTTP-based Web caching is disabled.

¡     Enable HTTPS-based Web caching.

https enable

By default, HTTPS-based Web caching is disabled.

Configuring Web caching backup

Restrictions and guidelines

Make sure the storage medium where the Web cache directory resides has sufficient storage space. The Web caching feature saves its operation data and the Web content to be cached to files in the directory. The directory typically needs a storage space of over 1 GB.

The backup Web cache directory for a Web cache view must reside on the backup slot.

Before specifying a Web cache directory, make sure all files in the upper-level directory are using a different name than the Web cache directory or have a file extension.

Procedure

1.     Enter system view.

system-view

2.     Enter Web cache view.

In standalone mode:

web-cache

In IRF mode:

web-cache slot slot-number

3.     Specify a backup Web caching slot.

In IRF mode:

backup slot slot-number

By default, the backup Web caching slot is not set.

4.     Set the backup Web cache directory.

file-directory directory

By default, the backup Web cache directory is not set.

After the backup Web cache directory is created, the device will not synchronize cache files under the primary directory to the backup directory.

Display and maintenance commands for Web caching

Execute the display command in any view.

 

Task

Command

Display Web caching information.

display web-cache [ history [ last { day | 30-days | 365-days | hour | minute | week } | verbose ] ]

Web caching configuration examples (in standalone mode)

Example: Configuring HTTP-based Web caching

Network configuration

As shown in Figure 4, Servers A, B, and C are HTTP servers and they listen for HTTP packets on port numbers 8001, 8002, and 80, respectively. Configure HTTP-based Web caching on the device to cache Web content from the HTTP servers.

Figure 4 Network diagram

 

Prerequisites

# Configure IP addresses for interfaces and make sure the device can reach the HTTP servers. (Details not shown.)

Procedure

1.     Create and enter Web cache view.

<Device> system-view

[Device] web-cache

2.     Configure Web caching parameters:

# Set the Web cache directory to #flash:/webcache.

[Device-web-cache] file-directory flash:/webcache

# Set the port number to 4001 for Web caching to listen for HTTP packets destined for Web server A that uses listening port number 8001.

[Device-web-cache] listen-port 4001 server-port 8001

# Set the port number to 4002 for Web caching to listen for HTTP packets destined for Web server B that uses listening port number 8002.

[Device-web-cache] listen-port 4002 server-port 8002

# Set the port number to 4003 for Web caching to listen for HTTP packets destined for Web server C that uses the listening port number 80.

[Device-web-cache] listen-port 4003

# Set the maximum total size for Web cache files to 10 GB.

[Device-web-cache] cache-limit 10

# Specify the types of the files on webpages to be cached.

[Device-web-cache] cached-data doc docx

# Specify an extension of the webpage files to be cached.

[Device-web-cache] cached-extension-name cab

3.     Enable HTTP-based Web caching.

[Device-web-cache] http enable

Verifying the configuration

# Display Web caching information after the host sends the first HTTP request to the Web servers.

[Device-web-cache] display web-cache

Capability information

  Cache path: flash:/webcache/proxy/cache

  Max connections: 1022

  Max cache size: 10GB

 

Current state information

  Cache memory: 25.0MB

  Cache count: 2

 

Statistics for past 1 minute

  ConnectTop: 4

  CacheTop: 25.0MB

  Bandwidth saved:                      0

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              25.0MB

  Download speed:                       3.3Mbps

  Download size:                        25.0MB

  CacheHitRate: 0%

    Hit count: 0                     Miss count: 3

 

...

 

Statistics for past 365 days

  ConnectTop: 4

  CacheTop: 25.0MB

  Bandwidth saved:                      0

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              25.0MB

  Download speed:                       3.3Mbps

  Download size:                        25.0MB

  CacheHitRate: 0%

    Hit count: 0                     Miss count: 3

# Display Web caching information after the host sends the second HTTP request for the same content to the Web servers.

[Device-web-cache] display web-cache

Capability information

  Cache path: flash:/webcache/proxy/cache

  Max connections: 1022

  Max cache size: 10GB

 

Current state information

  Cache memory: 25.0MB

  Cache count: 2

 

Statistics for past 1 minute

  ConnectTop: 3

  CacheTop: 25.0MB

  Bandwidth saved:                      3.3Mbps

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              25.0MB

  Download speed:                       0

  Download size:                        0

  CacheHitRate: 100%

    Hit count: 3                     Miss count: 0

The command output shows the Web caching feature is operating correctly.

·     The value of the Miss count field in the command output from the first display command is 3. The value of the Hit count field in the command output from the second display command is 3. The second HTTP request hits the Web cache.

·     The value of the Download size field in the command output from the second display command is 0. The value of the Bandwidth saved field in the command output from the second display command is 3.3 Mbps. This indicates that no Web data was downloaded from the Web servers to the device after the device sent the second HTTP request.

Example: Configuring HTTPS-based Web caching

Network configuration

As shown in Figure 5, Servers A, B, and C are HTTPS servers and they listen for HTTPS packets on port numbers 8001, 8002, and 443, respectively. Configure HTTPS-based Web caching on the device to cache Web content from the HTTPS servers.

Figure 5 Network diagram

 

Prerequisites

# Configure IP addresses for interfaces and make sure the device can reach the HTTPS servers. (Details not shown.)

Procedure

1.     Create and enter Web cache view.

<Device> system-view

[Device] web-cache

2.     Configure Web caching parameters:

# Set the Web cache directory to #flash:/webcache.

[Device-web-cache] file-directory flash:/webcache

# Set the port number to 4001 for Web caching to listen for HTTPS packets destined for Web server A that uses listening port number 8001.

[Device-web-cache] https listen-port 4001 server-port 8001

# Set the port number to 4002 for Web caching to listen for HTTPS packets destined for Web server B that uses listening port number 8002.

[Device-web-cache] https listen-port 4002 server-port 8002

# Set the port number to 4003 for Web caching to listen for HTTPS packets destined for Web server C that uses the listening port number 443.

[Device-web-cache] https listen-port 4003

# Set the maximum total size for Web cache files to 10 GB.

[Device-web-cache] cache-limit 10

# Specify the types of the files on webpages to be cached.

[Device-web-cache] cached-data doc docx

# Specify an extension of the webpage files to be cached.

[Device-web-cache] cached-extension-name cab

3.     Enable HTTPS-based Web caching.

[Device-web-cache] https enable

Verifying the configuration

# Display Web caching information after the host sends the first HTTPS request to the Web servers.

[Device-web-cache] display web-cache last minute

Web-cache configurations

  Cache path: flash:/webcache/proxy/cache

  Max connections: 1022

  Max cache size: 10GB

 

Current state information

  Cache memory: 25.0MB

  Cache count: 2

 

Statistics for past 1 minute

  ConnectTop: 4

  CacheTop: 25.0MB

  Bandwidth saved:                      0

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              25.0MB

  Download speed:                       3.3Mbps

  Download size:                        25.0MB

  CacheHitRate: 0%

    Hit count: 0                     Miss count: 3

# Display Web caching information after the host sends the second HTTP request for the same content to the Web servers.

[Device-web-cache] display web-cache last minute

Web-cache information

  Cache path: flash:/webcache/proxy/cache

  Max connections: 1022

  Max cache size: 10GB

 

Current state information

  Cache memory: 25.0MB

  Cache count: 2

 

Statistics for past 1 minute

  ConnectTop: 3

  CacheTop: 25.0MB

  Bandwidth saved:                      3.3Mbps

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              25.0MB

  Download speed:                       0

  Download size:                        0

  CacheHitRate: 100%

    Hit count: 3                     Miss count: 0

The command output shows the Web caching feature is operating correctly.

·     The value of the Miss count field in the command output from the first display command is 3. The value of the Hit count field in the command output from the second display command is 3. The second HTTP request hits the Web cache.

·     The value of the Download size field in the command output from the second display command is 0. The value of the Bandwidth saved field in the command output from the second display command is 3.3 Mbps. This indicates that no Web data was downloaded from the Web server to the device after the device sent the second HTTPS request.

Web caching configuration examples

Example: Configuring HTTP-based Web caching

Network configuration

As shown in Figure 6, Servers A, B, and C are HTTP servers and they listen for HTTP packets on port numbers 8001, 8002, and 80, respectively. Configure HTTP-based Web caching on the device to cache Web content from the HTTP server.

Figure 6 Network diagram

 

Prerequisites

# Configure IP addresses for interfaces and make sure the device can reach the HTTP servers. (Details not shown.)

Procedure

1.     Create and enter Web cache view.

<Device> system-view

[Device] web-cache slot 1

2.     Configure Web caching parameters:

# Set the Web cache directory to #flash:/webcache.

[Device-web-cache-slot1] file-directory flash:/webcache

# Set the port number to 4001 for Web caching to listen for HTTP packets destined for Web server A that uses listening port number 8001.

[Device-web-cache-slot1] listen-port 4001 server-port 8001

# Set the port number to 4002 for Web caching to listen for HTTP packets destined for Web server B that uses listening port number 8002.

[Device-web-cache-slot1] listen-port 4002 server-port 8002

# Set the port number to 4003 for Web caching to listen for HTTP packets destined for Web server C that uses the listening port number 80.

[Device-web-cache-slot1] listen-port 4003

# Set the maximum total size for Web cache files to 10 GB.

[Device-web-cache-slot1] cache-limit 10

# Specify the types of the files on webpages to be cached.

[Device-web-cache-slot1] cached-data doc docx

# Specify an extension of the webpage files to be cached.

[Device-web-cache] cached-extension-name cab

# Specify the backup Web caching slot.

[Device-web-cache-slot1] backup slot 2

# Set the backup Web caching directory.

[Device-web-cache-slot1] file-directory backup slot2#flash:/webcache2

3.     Enable HTTP-based Web caching.

[Device-web-cache-slot1] http enable

Verifying the configuration

# Display Web caching information after the host sends the first HTTP request to the Web servers.

[Device-web-cache-slot1] display web-cache

Capability information

  Cache path: slot1#flash:/webcache/proxy/cache

  Max connections: 1022

  Max cache size: 10GB

 

Current state information

  Cache memory: 25.0MB

  Cache count: 2

 

Statistics for past 1 minute

  ConnectTop: 4

  CacheTop: 25.0MB

  Bandwidth saved:                      0

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              25.0MB

  Download speed:                       3.3Mbps

  Download size:                        25.0MB

  CacheHitRate: 0%

    Hit count: 0                     Miss count: 3

 

...

 

Statistics for past 365 days

  ConnectTop: 4

  CacheTop: 25.0MB

  Bandwidth saved:                      0

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              25.0MB

  Download speed:                       3.3Mbps

  Download size:                        25.0MB

  CacheHitRate: 0%

    Hit count: 0                     Miss count: 3

# Display Web caching information after the host sends the second HTTP request for the same content to the Web servers.

[Device-web-cache-slot1] display web-cache

Capability information

  Cache path: slot1#flash:/webcache/proxy/cache

  Max connections: 1022

  Max cache size: 10GB

 

Current state information

  Cache memory: 25.0MB

  Cache count: 2

 

Statistics for past 1 minute

  ConnectTop: 3

  CacheTop: 25.0MB

  Bandwidth saved:                      3.3Mbps

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              25.0MB

  Download speed:                       0

  Download size:                        0

  CacheHitRate: 100%

    Hit count: 3                     Miss count: 0

 

...

 

Statistics for past 365 days

  ConnectTop: 3

  CacheTop: 25.0MB

  Bandwidth saved:                      3.3Mbps

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              50.0MB

  Download speed:                       3.3Mbps

  Download size:                        25.0MB

  CacheHitRate: 100%

    Hit count: 3                     Miss count: 3

The command output shows the Web caching feature is operating correctly.

·     The value of the Miss count field in the command output from the first display command is 3. The value of the Hit count field in the command output from the second display command is 3. The second HTTP request hits the Web cache.

·     The value of the Download size field in the command output from the second display command is 0. The value of the Bandwidth saved field in the command output from the second display command is 3.3 Mbps. This indicates that no Web data was downloaded from the Web server to the device after the device sent the second HTTP request.

# Display Web caching information after slot 1 fails.

[Device-web-cache-slot1] display web-cache

Capability information

  Cache path: slot2#flash:/webcache/proxy/cache

  Max connections: 1022

  Max cache size: 10GB

 

Current state information

  Cache memory: 25.0MB

  Cache count: 2

 

Statistics for past 1 minute

  ConnectTop: 3

  CacheTop: 25.0MB

  Bandwidth saved:                      3.3Mbps

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              25.0MB

  Download speed:                       0

  Download size:                        0

  CacheHitRate: 100%

    Hit count: 3                     Miss count: 0

 

...

 

Statistics for past 365 days

  ConnectTop: 3

  CacheTop: 25.0MB

  Bandwidth saved:                      3.3Mbps

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              50.0MB

  Download speed:                       3.3Mbps

  Download size:                        25.0MB

  CacheHitRate: 100%

    Hit count: 3                     Miss count: 3

The output shows that the Web caching directory has changed to the backup directory.

Example: Configuring HTTPS-based Web caching

Network configuration

As shown in Figure 7, Servers A, B, and C are HTTPS servers and they listen for HTTPS packets on port numbers 8001, 8002, and 443, respectively. Configure HTTPS-based Web caching on the device to cache Web content from the HTTPS servers.

Figure 7 Network diagram

 

Prerequisites

# Configure IP addresses for interfaces and make sure the device can reach the HTTPS servers. (Details not shown.)

Procedure

1.     Create and enter Web cache view.

<Device> system-view

[Device] web-cache slot 1

2.     Configure Web caching parameters:

# Set the Web cache directory to #flash:/webcache.

[Device-web-cache-slot1] file-directory flash:/webcache

# Set the port number to 4001 for Web caching to listen for HTTPS packets destined for Web server A that uses listening port number 8001.

[Device-web-cache-slot1] https listen-port 4001 server-port 8001

# Set the port number to 4002 for Web caching to listen for HTTPS packets destined for Web server B that uses listening port number 8002.

[Device-web-cache-slot1] https listen-port 4002 server-port 8002

# Set the port number to 4003 for Web caching to listen for HTTPS packets destined for Web server C that uses the listening port number 443.

[Device-web-cache-slot1] https listen-port 4003

# Set the maximum total size for Web cache files to 10 GB.

[Device-web-cache-slot1] cache-limit 10

# Specify the types of the files on webpages to be cached.

[Device-web-cache-slot1] cached-data doc docx

# Specify an extension of the webpage files to be cached.

[Device-web-cache-slot1] cached-extension-name cab

# Specify the backup Web caching slot.

[Device-web-cache-slot1] backup slot 2

# Set the backup Web caching directory.

[Device-web-cache-slot1] file-directory backup slot2#flash:/webcache2

3.     Enable HTTPS-based Web caching.

[Device-web-cache-slot1] https enable

Verifying the configuration

# Display Web caching information after the host sends the first HTTPS request to the Web servers.

[Device-web-cache-slot1] display web-cache

Capability information

  Cache path: slot1#flash:/webcache/proxy/cache

  Max connections: 1022

  Max cache size: 10GB

 

Current state information

  Cache memory: 25.0MB

  Cache count: 2

 

Statistics for past 1 minute

  ConnectTop: 4

  CacheTop: 25.0MB

  Bandwidth saved:                      0

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              25.0MB

  Download speed:                       3.3Mbps

  Download size:                        25.0MB

  CacheHitRate: 0%

    Hit count: 0                     Miss count: 3

 

...

 

Statistics for past 365 days

  ConnectTop: 4

  CacheTop: 25.0MB

  Bandwidth saved:                      0

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              25.0MB

  Download speed:                       3.3Mbps

  Download size:                        25.0MB

  CacheHitRate: 0%

    Hit count: 0                     Miss count: 3

# Display Web caching information after the host sends the second HTTP request for the same content to the Web servers.

[Device-web-cache-slot1] display web-cache

Capability information

  Cache path: slot1#flash:/webcache/proxy/cache

  Max connections: 1022

  Max cache size: 10GB

 

Current state information

  Cache memory: 25.0MB

  Cache count: 2

 

Statistics for past 1 minute

  ConnectTop: 3

  CacheTop: 25.0MB

  Bandwidth saved:                      3.3Mbps

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              25.0MB

  Download speed:                       0

  Download size:                        0

  CacheHitRate: 100%

    Hit count: 3                     Miss count: 0

 

...

 

Statistics for past 365 days

  ConnectTop: 3

  CacheTop: 25.0MB

  Bandwidth saved:                      3.3Mbps

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              50.0MB

  Download speed:                       3.3Mbps

  Download size:                        25.0MB

  CacheHitRate: 100%

    Hit count: 3                     Miss count: 3

The command output shows the Web caching feature is operating correctly.

·     The value of the Miss count field in the command output from the first display command is 1. The value of the Hit count field in the command output from the second display command is 1. The second HTTP request hits the Web cache.

·     The value of the Download size field in the command output from the second display command is 0. The value of the Bandwidth saved field in the command output from the second display command is 3.3 Mbps. This indicates that no Web data was downloaded from the Web server to the device after the device sent the second HTTPS request.

# Display Web caching information after slot 1 fails.

[Device-web-cache-slot1] display web-cache

Capability information

  Cache path: slot2#flash:/webcache/proxy/cache

  Max connections: 1022

  Max cache size: 10GB

 

Current state information

  Cache memory: 25.0MB

  Cache count: 2

 

Statistics for past 1 minute

  ConnectTop: 3

  CacheTop: 25.0MB

  Bandwidth saved:                      3.3Mbps

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              25.0MB

  Download speed:                       0

  Download size:                        0

  CacheHitRate: 100%

    Hit count: 3                     Miss count: 0

 

...

 

Statistics for past 365 days

  ConnectTop: 3

  CacheTop: 25.0MB

  Bandwidth saved:                      3.3Mbps

  Cached data transmission speed:       3.3Mbps

  Cached data transmitted:              50.0MB

  Download speed:                       3.3Mbps

  Download size:                        25.0MB

  CacheHitRate: 100%

    Hit count: 3                     Miss count: 3

The output shows that the Web caching directory has changed to the backup directory.

Troubleshooting Web caching

Web caching enabling failure

Symptom

Web caching failed to be enabled.

Analysis

The TCP port number specified for Web caching must belong to Web caching exclusively. If any other services on the device are using the same TCP port number, Web caching cannot be enabled.

Solution

To resolve the problem:

1.     Execute the display tcp verbose command to display TCP port numbers being used.

2.     Specify an unused TCP port number as the Web caching listening port number.

Web caching backup failure

Symptom

The device does not use the backup Web caching slot for Web caching after the primary Web caching slot reboots.

Analysis

If the storage medium of the backup Web caching slot is inaccessible or is not correctly configured, the Web caching service cannot be enabled on the backup Web caching slot.

Solution

To resolve the problem:

1.     Execute the dir command to display information about the backup Web caching slot and then make sure the storage medium of the directory is accessible.

For more information about the dir command, see file system management commands in Fundamentals Command Reference.

2.     If the issue persists, contact H3C Support.

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网