07-Layer 3—IP Services Configuration Guide

HomeSupportResource CenterTechnical DocumentsConfigure & DeployConfiguration GuidesH3C MSR810[830][2600][3600] Routers Configuration Guides(V7)-R0821-6W50007-Layer 3—IP Services Configuration Guide
23-Web caching configuration
Title Size Download
23-Web caching configuration 144.88 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.

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 Web caching feature is configured to cache Web content from the Web server.

¡     If not, the device forwards the request directly to the Web server. The Web caching feature does not take part in the communication between the host and the Web server.

¡     If yes, the device forwards the request to 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.

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.

Restrictions: Hardware compatibility with Web caching

Hardware

Web caching compatibility

MSR 810, MSR 810-W, MSR 810-W-DB, MSR 810-LM, MSR 810-W-LM, MSR 810-10-PoE, MSR 810-LM-HK, MSR 810-W-LM-HK, MSR 810-LM-CNDE-SJK, MSR 810-CNDE-SJK

Yes

MSR 810-LMS, MSR 810-LUS

No

MSR 810-LMS-EA, MSR 810-LME

Yes

MSR 2600-6-X1, MSR 2600-10-X1

Yes

MSR 2630

Yes

MSR 3600-28, MSR 3600-51

Yes

MSR 3600-28-SI, MSR 3600-51-SI

No

MSR 3600-28-X1, MSR 3600-28-X1-DP, MSR 3600-51-X1, MSR 3600-51-X1-DP

Yes

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

Yes

MSR 3610-X1, MSR 3610-X1-DP, MSR 3610-X1-DC, MSR 3610-X1-DP-DC

Yes

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

Yes

MSR 3610-G, MSR 3620-G

Yes

 

Hardware

Web caching compatibility

MSR 810-W-WiNet, MSR 810-LM-WiNet

Yes

MSR 830-4LM-WiNet

Yes

MSR 830-5BEI-WiNet, MSR 830-6EI-WiNet, MSR 830-10BEI-WiNet

Yes

MSR 830-6BHI-WiNet, MSR 830-10BHI-WiNet

Yes

MSR 2600-6-WiNet, MSR 2600-10-X1-WiNet

Yes

MSR 2630-WiNet

Yes

MSR 3600-28-WiNet

Yes

MSR 3610-X1-WiNet

Yes

MSR 3610-WiNet, MSR 3620-10-WiNet, MSR 3620-DP-WiNet, MSR 3620-WiNet, MSR 3660-WiNet

Yes

 

Hardware

Web caching compatibility

MSR 2630-XS

Yes

MSR 3600-28-XS

Yes

MSR 3610-XS

Yes

MSR 3620-XS

Yes

MSR 3610-I-XS

Yes

MSR 3610-IE-XS

Yes

 

Hardware

Web caching compatibility

MSR 810-LM-GL

Yes

MSR 810-W-LM-GL

Yes

MSR 830-6EI-GL

Yes

MSR 830-10EI-GL

Yes

MSR 830-6HI-GL

Yes

MSR 830-10HI-GL

Yes

MSR 2600-6-X1-GL

Yes

MSR 3600-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 Web caching parameters

2.     Enabling Web caching

Configuring Web caching parameters

Restrictions and guidelines

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

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

To cache only Web content from certain Web servers, configure an IPv4 object group to identify the Web servers. For more information about the IPv4 object group feature, see object group configuration in Security Configuration Guide.

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 the 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.

If you specify both webpage files and types of the webpage files to be cached, the device caches matching webpage files of the specified types.

5.     Set the Web caching listening port number.

¡     Set the port number for Web caching to listen for HTTP packets.

listen-port port-number

¡     Set the port number for Web caching to listen for HTTPS packets.

https listen-port port-number

By default, Web caching uses port 80 to listen for HTTP packets and port 443 to listen for HTTPS packets.

Make sure the specified TCP port number is not being used by any other services on the device. To display TCP port numbers in use, execute the display tcp verbose command.

6.     (Optional.) Specify an IPv4 object group used to filter Web content to be cached.

object-group [ source ] ip object-group-name

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

To cache Web content requested by specific Web clients, specify the source keyword. To cache Web content sent from specific Web servers, do not specify the source keyword.

7.     Set the Web cache directory.

file-directory directory

By default, the Web cache directory is not set.

8.     (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.

Enabling Web caching

Restrictions and guidelines

Before enabling Web caching, you must configure the types of the webpage files to be cached and the 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.

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.     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.

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 2, configure HTTP-based Web caching on the device to cache Web content from the HTTP server.

Figure 2 Network diagram

 

Prerequisites

# Configure IP addresses for interfaces. (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 9955 for Web caching to listen for HTTP packets.

[Device-web-cache] listen-port 9955

# 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

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 server.

[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: 1

 

...

 

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: 1

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

[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: 1                     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: 1                     Miss count: 1

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 servers to the device after the device sent the second HTTP request.

Example: Configuring HTTPS-based Web caching

Network configuration

As shown in Figure 3, configure HTTPS-based Web caching on the device to cache Web content from the HTTPS server.

Figure 3 Network diagram

 

Prerequisites

# Configure IP addresses for interfaces. (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 9955 for Web caching to listen for HTTPS packets.

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

# 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

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 server.

[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: 1

 

...

 

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: 1

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

[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: 1                     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: 1                     Miss count: 1

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.

Web caching configuration examples

Example: Configuring HTTP-based Web caching

Network configuration

As shown in Figure 4, configure HTTP-based Web caching on the device to cache Web content from the HTTP server.

Figure 4 Network diagram

 

Prerequisites

# Configure IP addresses for interfaces. (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 9955 for Web caching to listen for HTTP packets.

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

# 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

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 server.

[Device-web-cache-slot1] 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: 1

 

...

 

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: 1

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

[Device-web-cache-slot1] 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: 1                     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: 1                     Miss count: 1

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.

Example: Configuring HTTPS-based Web caching

Network configuration

As shown in Figure 5, configure HTTPS-based Web caching on the device to cache Web content from the HTTPS server.

Figure 5 Network diagram

 

Prerequisites

# Configure IP addresses for interfaces. (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 9955 for Web caching to listen for HTTPS packets.

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

# 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

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 server.

[Device-web-cache-slot1] 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: 1

 

...

 

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: 1

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

[Device-web-cache-slot1] 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: 1                     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: 1                     Miss count: 1

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.

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.

 

  • 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
新华三官网