- Table of Contents
-
- 13-Layer 3—IP Services Configuration Guide
- 00-Preface
- 01-IP addressing configuration
- 02-IP forwarding basics configuration
- 03-Fast forwarding configuration
- 04-ARP configuration
- 05-IPv6 basics configuration
- 06-IPv6 fast forwarding configuration
- 07-DHCP configuration
- 08-DHCPv6 configuration
- 09-DNS configuration
- 10-IP performance optimization configuration
- 11-Multi-CPU packet distribution configuration
- 12-Adjacency table configuration
- 13-Web caching configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
13-Web caching configuration | 84.30 KB |
Contents
Restrictions: Software version compatibility with Web caching
License requirement for Web caching
Restrictions and guidelines: Web caching configuration
Configuring Web caching parameters
Display and maintenance commands for Web caching
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.
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.
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: Software version compatibility with Web caching
Web caching is supported only in RXX60P20 and later.
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
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.
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 primary Web cache directory.
file-directory directory
By default, the primary 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.
9. (Optional.) Configure the Web caching backup feature.
a. Specify the backup Web caching slot.
backup slot slot-number
By default, no backup Web caching slot is specified.
b. Set the backup Web cache directory.
file-directory backup directory
By default, no backup Web cache directory is set.
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.
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 ] ] |
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.