- Table of Contents
-
- 06-Layer 3—IP Services Command Reference
- 00-Preface
- 01-ARP commands
- 02-IP addressing commands
- 03-DHCP commands
- 04-DNS commands
- 05-NAT commands
- 06-NAT66 commands
- 07-IP forwarding basics commands
- 08-Fast forwarding commands
- 09-Multi-CPU packet distribution commands
- 10-Adjacency table commands
- 11-IP performance optimization commands
- 12-UDP helper commands
- 13-IPv6 basics commands
- 14-DHCPv6 commands
- 15-IPv6 fast forwarding commands
- 16-AFT commands
- 17-Tunneling commands
- 18-GRE commands
- 19-ADVPN commands
- 20-WAAS commands
- 21-Web caching commands
- 22-HTTP proxy commands
- 23-IRDP commands
- 24-STUN commands
- Related Documents
-
Title | Size | Download |
---|---|---|
21-Web caching commands | 191.32 KB |
Web caching commands
backup
Use backup to specify a backup Web caching slot.
Use undo backup to restore the default.
Syntax
In standalone mode:
backup slot slot-number
undo backup
In IRF mode:
backup chassis chassis-number slot slot-number
undo backup
Default
No backup Web caching slot is specified.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Parameters
slot slot-number: Specifies a card by its slot number. (In standalone mode.)
chassis chassis-number slot slot-number: Specifies a card on an IRF member device. The chassis-number argument represents the member ID of the IRF member device. The slot-number argument represents the slot number of the card. (In IRF mode.)
Usage guidelines
To enhance the high availability of Web caching, configure the Web cache backup feature. You can use this command to specify a backup Web caching slot. When the primary slot (specified by using the web-cache command) 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.
Examples
# (In standalone mode.) Specify a backup Web caching slot.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] backup slot 2
# (In IRF mode.) Specify a backup Web caching slot.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 0
[Sysname-web-cache-slot1] backup chassis 1 slot 1
cached-data
Use cached-data to specify the types of the webpage files to be cached.
Use undo cached-data to restore the default.
Syntax
cached-data { apk | bmp | doc | docx | gif | gzip | ipa | jar | jpg | jpeg | mp4 | pdf | png | ppt | pptx | rar | swf | tar | txt | xls | xlsx | zip } *
undo cached-data
Default
No webpage file types are specified.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Parameters
apk: Specifies .apk files.
bmp: Specifies .bmp files.
doc: Specifies .doc files.
docx: Specifies .docx files.
gif: Specifies .gif files.
gzip: Specifies .gzip files.
ipa: Specifies .ipa files.
jar: Specifies .jar files.
jpg: Specifies .jpg files.
jpeg: Specifies .jpeg files.
mp4: Specifies .mp4 files.
pdf: Specifies .pdf files.
png: Specifies .png files.
ppt: Specifies .ppt files.
pptx: Specifies .pptx files.
rar: Specifies .rar files.
swf: Specifies .swf files.
tar: Specifies .tar files.
txt: Specifies .txt files.
xls: Specifies .xls files.
xlsx: Specifies .xlsx files.
zip: Specifies .zip files.
Usage guidelines
If you do not specify the types of the webpage files to be cached, the Web caching feature does not cache any types of files on webpages.
Execute this command before enabling Web caching.
Before configuring or modifying file type settings, you must disable Web caching. After configuring or modifying file type settings, enable Web caching again.
Execution of the undo cached-data command will not delete webpage files saved in the Web cache directory. The Web caching feature can still cache webpage files specified by using the cached-file command.
Examples
# (In standalone mode.) Configure the Web caching feature to cache .doc and .docx files on webpages.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] cached-data doc docx
# (In IRF mode.) Configure the Web caching feature to cache .doc and .docx files on webpages.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] cached-data doc docx
Related commands
http enable
https enable
cached-data aging-time
Use cached-data aging-time to specify the aging time for Web cache files.
Use undo cached-data aging-time to restore the default.
Syntax
cached-data aging-time aging-time
undo cached-data aging-time
Default
The aging time for Web cache files is 1440 minutes.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Parameters
aging-time: Specifies the aging time for Web cache files in minutes. The value range for this argument is 60 to 43200 minutes.
Usage guidelines
The device deletes Web cache files that are not requested by users before the aging timer expires to save the storage space. Use this command to edit the aging time for Web cache files:
· If the device storage space is sufficient, set a long aging time for Web cache files.
· If the device storage space is insufficient, set a short aging time for Web cache files.
Examples
# (In standalone mode.) Set the aging time for Web cache files to 1572 minutes.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] cached-data aging-time 1572
# (In IRF mode.) Set the aging time for Web cache files to 1572 minutes.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] cached-data aging-time 1572
cached-data exclude
Use cached-data exclude to specify webpage files not to be cached.
Use undo cached-data exclude to restore the default.
Syntax
cached-data exclude { acp | ashx | asp | cgi | chk | chm | eml | ephtml | html | json | php | phtml | shtml | ska | tmp | filename-keyword keyword }
undo cached-data exclude [ acp | ashx | asp | cgi | chk | chm | eml | ephtml | html | json | php | phtml | shtml | ska | tmp | filename-keyword keyword ]
Default
Web caching can cache all webpage files.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Parameters
acp: Specifies files that include keyword acp in the file name.
ashx: Specifies files that include keyword ashx in the file name.
asp: Specifies files that include keyword asp in the file name.
cgi: Specifies files that include keyword cgi in the file name.
chk: Specifies files that include keyword chk in the file name.
chm: Specifies files that include keyword chm in the file name.
eml: Specifies files that include keyword eml in the file name.
ephtml: Specifies files that include keyword ephtml in the file name.
html: Specifies files that include keyword html in the file name.
json: Specifies files that include keyword json in the file name.
php: Specifies files that include keyword php in the file name.
phtml: Specifies files that include keyword phtml in the file name.
shtml: Specifies files that include keyword shtml in the file name.
ska: Specifies files that include keyword ska in the file name.
tmp: Specifies files that include keyword tmp in the file name.
filename-keyword: Configures Web caching not to cache webpage files that include the specified keyword in the file name.
keyword: Specifies a keyword in the webpage file name. The keyword is a case-sensitive string of 1 to 127 characters. The specified keyword cannot be acp, ashx, asp, cgi, chk, chm, eml, ephtml, html, json, php, phtml, shtml, ska, or tmp.
Usage guidelines
Application scenarios
By default, the device can cache all webpage files. To save the device storage space, use this command to specify webpage files not to be cached.
Restrictions and guidelines
All the file name keywords that can be specified are case-sensitive.
You can execute this command multiple times to specify multiple keywords in names of webpage files not to be cached. A maximum of 64 keywords are supported.
Execute this command before enabling Web caching.
The cached-data, cached-data exclude, cached-file, and cached-extension-name commands are mutually exclusive.
Examples
# (In standalone mode.) Configure Web caching not to cache webpage files that have keyword json in the file name.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] cached-data exclude json
# (In IRF mode.) Configure Web caching not to cache webpage files that have keyword json in the file name.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] cached-data exclude json
# (In standalone mode.) Configure Web caching not to cache webpage files that have keyword abc in the file name.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] cached-data exclude filename-keyword abc
# (In IRF mode.) Configure Web caching not to cache webpage files that have keyword abc in the file name.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] cached-data exclude filename-keyword abc
Related commands
cached-data
cached-extension-name
cached-file
cached-extension-name
Use cached-extension-name to specify an extension of files to be cached.
Use undo cached-extension-name to remove extensions of files to be cached.
Syntax
cached-extension-name extension-name
undo cached-extension-name [ extension-name ]
Default
No extensions are specified for files to be cached.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Parameters
extension-name: Specifies a file extension by its name, a case-sensitive string of 1 to 16 characters. Valid characters include letters, digits, underscores (_), and hyphens (-).
Usage guidelines
Use this command to specify a file type by its extension if the file type is not available for the cached-data command.
You can configure this command multiple times to specify a maximum of 64 file extensions.
Execute this command before enabling Web caching.
Before configuring or modifying file extension settings, you must disable Web caching. After configuring or modifying file extension settings, enable Web caching again.
If you specify webpage files to be cached by file name, file type, and file extension, the device caches webpages file in the following order:
1. Webpage files with a file name specified by using the cached-file command.
2. Webpage files with a file type specified by using the cached-data command or file extension specified by using the cached-extension-name command.
Examples
# (In standalone mode.) Configure the Web caching feature to cache files with extension name cab.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] cached-extension-name cab
Related commands
cached-data
cached-file
cached-file
Use cached-file to specify a webpage file to be cached.
Use undo cached-file to remove webpage files to be cached.
Syntax
cached-file file-name
undo cached-file [ file-name ]
Default
No webpage files can be cached.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Parameters
file-name: Specifies a webpage file by its name, a case-sensitive string of 1 to 127 characters.
Usage guidelines
You can repeat this command to specify multiple webpage files to be cached.
If you specify both webpage files and types of the webpage files to be cached, the device caches the matching webpage files of the specified types.
Before you add or delete a webpage file to be cached, you must disable Web caching. After adding or deleting the webpage file, enable Web caching again.
Execution of the undo cached-file command will not delete webpage files saved in the Web cache directory.
Examples
# (In standalone mode.) Specify file test1.doc as a webpage file to be cached.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] cached-file test1.doc
# (In IRF mode.) Specify file test1.doc as a webpage file to be cached.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] cached-file test1.doc
Related commands
cached-data
cache-ignore
Use cache-ignore to configure Web caching to ignore the specified HTTP/HTTPS response headers.
Use undo cache-ignore to restore the default.
Syntax
cache-ignore { cache-control | set-cookie | vary } *
undo cache-ignore [ cache-control | set-cookie | vary ] *
Default
Whether Web caching caches Web resources is affected by the HTTP/HTTPS response header type.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Parameters
cache-control: Specifies Cache-Control headers.
set-cookie: Specifies Set-Cookie headers.
vary: Specifies Vary headers.
Usage guidelines
The HTTP/HTTPS response header type affects Web caching as follows:
· If the HTTP/HTTPS response has a Cache-Control header, whether Web caching caches the requested Web resources depends on the instructions in the header.
· If the HTTP/HTTPS response has a Set-Cookie header, Web caching does not cache the requested Web resources.
· If the HTTP/HTTPS response has a Vary header, whether Web caching caches the requested Web resources depends on the value for the Vary field.
To make sure Web caching caches the requested Web resources, configure Web caching to ignore the specified HTTP/HTTPS response headers.
Examples
# (In standalone mode.) On slot 1, configure Web caching to ignore the Cache-Control and Vary response headers.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] cache-ignore cache-control vary
cache-limit
Use cache-limit to set the maximum total size for Web cache files.
Use undo cache-limit to restore the default.
Syntax
cache-limit size
undo cache-limit
Default
The maximum total size of Web cache files is 4 GB.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Parameters
size: Specifies the maximum total size for Web cache files in GB. The value range is 1 to 4095. The default is 4.
Usage guidelines
Before changing the maximum total file size setting, you must disable Web caching. After changing the maximum total file size setting, enable Web caching again.
The maximum total size for Web cache files must be smaller than the maximum storage space size in the working directory. To display the maximum size of storage space in the working directory, execute the display web-cache command. After the effective maximum total size is reached, the device deletes the oldest Web cache file to save the new Web cache file.
The aging time for Web cache files is fixed at 30 days. When the device reboots or receives a request for the content in a Web cache file, it restarts the aging timer. If no users request the content in a file before the aging timer expires, the device deletes the file.
Examples
# (In standalone mode.) Set the maximum total size for Web cache files to 3 GB.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] cache-limit 3
# (In IRF mode.) Set the maximum total size for Web cache files to 3 GB.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] cache-limit 3
display web-cache
Use display web-cache to display Web caching information.
Syntax
display web-cache [ history [ last { day | 30-days | 365-days | hour | minute | week } | verbose ] ]
Views
Any view
Predefined user roles
network-admin
network-operator
mdc-admin
mdc-operator
Parameters
history: Displays history information. If you specify this keyword but do not specify any following keywords, the command displays the current statistics, which is collected at 1-second intervals. If you do not specify this keyword, the command displays Web cache configuration and statistics for the most recent time ranges.
last: Displays statistics for a specific period of time in the past. If you do not specify this keyword, the command displays the current statistics and the statistics for specific periods of time in the past.
minute: Displays statistics for the most recent one minute.
hour: Displays statistics for the most recent one hour.
day: Displays statistics for the most recent one day.
week: Displays statistics for the most recent one week.
30-days: Displays statistics for the most recent 30 days.
365-days: Displays statistics for the most recent 365 days.
verbose: Displays detailed information. If you do not specify this keyword, the command displays brief information.
Examples
# Display the current Web caching statistics.
<Sysname> display web-cache history
Date TimeRange ConnectTop CacheTop BandwidthSaved CacheHitRate
2018/06/20 14:43:02-14:43:03 3 16.0KB 0 0%
2018/06/20 14:43:01-14:43:02 3 16.0KB 96.0Kbps 100%
# Display all Web caching information.
<Sysname> display web-cache
Web-cache configurations
Cache path: flash:/var/web-cache/proxy/cache
Max connections: 1022
Max cache size: 3GB
Current state information
Cache memory: 0
Cache count: 0
Statistics for past 1 minute
ConnectTop: 2
CacheTop: 0
Bandwidth saved: 0
Cached data transmission speed: 0
Cached data transmitted: 0
Download speed: 0
Download size: 0
CacheHitRate: 0%
Hit count: 0 Miss count: 0
Statistics for past 1 hour
ConnectTop: 2
CacheTop: 0
Bandwidth saved: 0
Cached data transmission speed: 0
Cached data transmitted: 0
Download speed: 0
Download size: 0
CacheHitRate: 0%
Hit count: 0 Miss count: 0
Statistics for past 1 day
ConnectTop: 2
CacheTop: 463.4MB
Bandwidth saved: 0
Cached data transmission speed: 0
Cached data transmitted: 0
Download speed: 0
Download size: 0
CacheHitRate: 0%
Hit count: 0 Miss count: 0
Statistics for past 30 days
ConnectTop: 2
CacheTop: 463.4MB
Bandwidth saved: 0
Cached data transmission speed: 0
Cached data transmitted: 0
Download speed: 0
Download size: 0
CacheHitRate: 0%
Hit count: 0 Miss count: 0
Statistics for past 365 days
ConnectTop: 2
CacheTop: 463.4MB
Bandwidth saved: 0
Cached data transmission speed: 120 Kbps
Cached data transmitted: 400MB
Download speed: 0
Download size: 0
CacheHitRate: 0%
Hit count: 0 Miss count: 0
# Display detailed current Web caching statistics.
<Sysname> display web-cache history verbose
2018/06/05 09:02:47-09:02:48
ConnectTop: 2
CacheTop: 0
Bandwidth saved: 0
Cached data transmission speed: 0
Cached data transmitted: 0
Download speed: 0
Download size: 0
CacheHitRate: 0%
Hit count: 0 Miss count: 0
2018/06/05 09:02:46-09:02:47
ConnectTop: 2
CacheTop: 0
Bandwidth saved: 0
Cached data transmission speed: 0
Cached data transmitted: 0
Download speed: 0
Download size: 0
CacheHitRate: 0%
Hit count: 0 Miss count: 0
Table 1 Command output
Field |
Description |
Cache path |
Web cache directory. |
Max connections |
Maximum number of connections allowed. |
Max cache size |
Current maximum storage space size. |
Cache memory |
Current total size of Web cache files. |
Cache count |
Number of Web cache files. |
Statistics for past 1 minute |
Web caching statistics for the most recent one minute. |
Statistics for past 1 hour |
Web caching statistics for the most recent one hour. |
Statistics for past 1 day |
Web caching statistics for the most recent one day. |
Statistics for past 30 days |
Web caching statistics for the most recent 30 days. |
Statistics for past 365 days |
Web caching statistics for the most recent 365 days. |
ConnectTop |
Maximum number of connections during the specified period of time. |
CacheTop |
Maximum total size of Web cache files during the specified period of time, in KB, MB, GB, or TB. |
Bandwidth saved |
Bandwidth saved during the specified period of time, in Kbps, Mbps, Gbps, or Tbps. |
Cached data transmission speed |
Speed at which cached data was transferred to users during the specified period of time, in Kbps, Mbps, Gbps, or Tbps. |
Cached data transmitted |
Amount of cached data that was transferred to users during the specified period of time, in KB, MB, GB, or TB. |
Download speed |
Speed at which cached data was downloaded from Web servers during the specified period of time, in Kbps, Mbps, Gbps, or Tbps. |
Download size |
Amount of cached data that was downloaded from Web servers during the specified period of time, in KB, MB, GB, or TB. |
CacheHitRate |
Percentage of hits of cached data. |
Hit count |
Number of hits of cached data. |
Miss count |
Number of times that cached data was not matched. |
display web-cache cached-data
Use display web-cache cached-data to display information about files cached by Web caching.
Syntax
display web-cache cached-data [ domain-name domain-name ]
Views
Any view
Predefined user roles
network-admin
network-operator
mdc-admin
mdc-operator
Parameters
domain-name domain-name: Displays information about files cached from the Web server with the specified domain name. The domain name is a dot-separated string (for example, example.com) of up to 255 characters. If you do not specify a domain dame, this command displays information about files cached from all Web servers.
Usage guidelines
The device can display information about up to 100 cached files for each domain name.
Examples
# Display information about files cached from all Web servers.
<Sysname> display web-cache cached-data
Current domain count: 2
Domain: www.abc.example.com
Total saved data: 21MB
Total saved files: 2
Total cached size: 3000MB
FileName HitCount Size HitRate SavedData DeliverySpeed DownloadSpeed
a.txt 3 1000MB 0.75 3000MB 20KB/s 1KB/s
b.txt 1 2000MB 0.5 2000MB 30KB/s 2KB/s
Domain: www.efg.example.com
Total saved data: 24MB
Total saved files: 2
Total cached size: 18000MB
FileName HitCount Size HitRate SavedData DeliverySpeed DownloadSpeed
c.rar 2 8000MB 0.67 16000MB 22KB/s 1KB/s
d.zip 4 10000MB 0.8 80000MB 29KB/s 2KB/s
Table 2 Command output
Field |
Description |
Current domain count |
Total number of Web servers that provide files to be cached. |
Domain |
Domain name of the Web server. |
Total saved data |
Size of access data saved by the cached files, in MB. |
Total saved files |
Total number of files cached from the Web server. |
Total cached size |
Total size of files cached from the Web server. |
FileName |
Name of the cached file. |
HitCount |
Number of times the user successfully requested the file. |
Size |
Size of the file in bytes. |
HitRate |
Hit rate of the file. The value is the ratio of the number of times the device successfully responds to the user with the file to the number of times the user requests the file from the device. |
SavedData |
Size of access data saved by the file, in bytes. |
DeliverySpeed |
Transmission rate at which the device last sent the file to the user host, in KB/s. |
DownloadSpeed |
Transmission rate at which the device last obtained the file from the Web server, in KB/s. |
display web-cache deny-list
Use display web-cache deny-list to display the address list of Web servers from which the device does not cache data.
Syntax
display web-cache deny-list { ipv4 | ipv6 } [ aged-ip ]
Views
Any view
Predefined user roles
network-admin
network-operator
mdc-admin
mdc-operator
Parameters
ipv4: Displays the IPv4 address list of Web servers from which the device does not cache data.
ipv6: Displays the IPv6 address list of Web servers from which the device does not cache data.
aged-ip: Displays the aged address list of Web servers from which the device does not cache data. The list displays only the most recent 100 IPv4 and IPv6 address entries that have aged out. Address entries age out 24 hours after they were generated. If you do not specify this keyword, the command displays the list of address entries that do not age out.
Usage guidelines
When users request Web resources not cached by the device, the device must send HTTP or HTTPS requests to Web servers to obtain the requested Web resources. The processes in which the device requests Web resources from Web servers and responds to users might fail. To avoid device performance waste caused by repeated request failures, the device records information about the IP addresses of Web servers from which it fails to request Web resources as entries. The device does not cache Web resources from the Web servers until the corresponding entries age out. Use this command to display the address list of Web servers from which the device does not cache data.
Examples
# Displays the IPv4 address list of Web servers from which the device does not cache data.
<Sysname> display web-cache deny-list ipv4
IP Time Reason
192.168.1.12 2022/2/22 12:12:30 Client sent duplicate header lines
192.168.2.12 2022/2/22 12:12:30 Parsing request line failed
# Displays the IPv6 address list of Web servers from which the device does not cache data.
<Sysname> display web-cache deny-list ipv6
IPv6 Time Reason
1::1 2022/2/22 12:12:30 Parsing request line failed
Table 3 Command output
Field |
Description |
IP |
IP address of the Web server. |
Time |
Time when the device failed to request resources from the Web server. |
Reason |
Request failure causes: · Reading request line timed out. · Domain name requested by client was invalid. · Parsing request line failed. · Reading request header timed out. · Reading request header failed. · Client sent duplicate header lines. · Invalid field existed in HTTP request header. · A field was missing in request. · Unknown transmission code existed in request. · HTTP request method: TRACE. · Reading request body timed out. · Connecting server failed. · Sending request to server failed. · Sending request to server timed out. · Receiving server response failed. · Handling response header failed. · Inputting filter criterion failed. · Copying header line failed. · Copying operation field failed. · Sending response to client failed. · Testing the predicate failed. · Couldn't generate cache files. · Client request timed out during HTTP protocol upgrade. · Server response timed out during HTTP protocol upgrade. · Reading server response header timed out. |
dual-gateway-channel
Use dual-gateway-channel to configure a channel for traffic direction with the peer gateway.
Use undo dual-gateway-channel to delete the traffic direction channels.
Syntax
dual-gateway-channel [ vpn-instance vpn-instance-name ] interface interface-type interface-number peer ipv4-address
undo dual-gateway-channel [ vpn-instance vpn-instance-name ]
Default
No channels are configured for traffic direction with the peer gateway.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Parameters
vpn-instance vpn-instance-name: Specifies the VPN instance of the peer gateway. The vpn-instance-name argument represents the VPN instance name, a case-sensitive string of 1 to 31 characters. The specified VPN instance must have existed. If you do not specify a VPN instance, this command applies to the peer gateway device in the public network.
interface interface-type interface-number: Specifies the traffic direction channel interface by its type and number.
peer ipv4-address: Specifies the IPv4 address of the peer gateway. This address must be a unicast address.
Usage guidelines
This command applies to the Web cache dual gateway scenario. In this scenario, two gateways provide the Web cache service for users simultaneously, 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. The downlink traffic therefore cannot be forwarded to the users and the users cannot access the requested Web resources as a result.
To avoid this issue, you can use this command to configure a traffic direction channel with the peer gateway. If the device receives Web cache downlink traffic for a user that it cannot find, the device 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.
|
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. |
Before you execute this command, disable the Web cache feature. After this command is executed again, enable the Web cache feature again.
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 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.
Examples
# (In standalone mode.) Specify channel interface GigabitEthernet 2/0/1 for traffic direction with peer gateway 1.1.1.1 in VPN instance test.
<Sysname> system
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] dual-gateway-channel vpn-instance test interface gigabitethernet 2/0/1 peer 1.1.1.1
# (In IRF mode.) Specify channel interface GigabitEthernet 2/0/1 for traffic direction with peer gateway 1.1.1.1 in VPN instance test.
<Sysname> system
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] dual-gateway-channel vpn-instance test interface gigabitethernet 2/0/1 peer 1.1.1.1
file-directory
Use file-directory to set the primary Web cache directory.
Use undo file-directory to restore the default.
Syntax
file-directory directory
undo file-directory
Default
The primary Web cache directory is not set.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Parameters
directory: Specifies the primary Web cache directory, starting from the storage medium location information slotn#. The slot number n must be the same as the slot number of the Web cache view. (In standalone mode.)
directory: Specifies the primary Web cache directory, starting from the storage medium location information chassismslotn#. The chassis number m and slot number n must be the same as the chassis number and slot number of the Web cache view. (In IRF mode.)
Usage guidelines
Before changing the Web cache directory, you must disable Web caching. After changing the Web cache directory, enable Web caching again.
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.
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. For example, if you want to specify flash:/web-cache as the Web cache directory, files without a file extension in the flash: directory cannot use web-cache as the file name.
The primary Web cache directory for a Web cache view must reside on the same slot as the Web view.
Examples
# (In standalone mode.) Set the primary Web cache directory.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] file-directory slot1#flash:/aaa
# (In IRF mode.) Set the primary Web cache directory.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] file-directory chassis1#slot1#flash:/aaa
file-directory backup
Use file-directory backup to set the backup Web cache directory.
Use undo file-directory backup to restore the default.
Syntax
file-directory backup directory
undo file-directory backup
Default
No backup Web cache directory is set.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Parameters
directory: Specifies the backup Web cache directory, starting from the storage medium location information slotn#. The slot number n must be the same as the slot number of the Web cache view. (In standalone mode.)
directory: Specifies the backup Web cache directory, starting from the storage medium location information chassismslotn#. The chassis number m and slot number n must be the same as the chassis number and slot number of the Web cache view. (In IRF mode.)
Usage guidelines
To implement Web cache backup, use this command to specify the backup Web cache directory. When the device uses the primary slot for Web caching, it saves webpage files to the primary Web cache directory. When the device uses the backup Web caching slot, it saves webpage files to the backup Web cache directory.
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. After the backup Web cache directory is created, the device will not synchronize cache files under the primary directory to the backup directory.
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. For example, if you want to specify flash:/web-cache as the Web cache directory, files without a file extension in the flash: directory cannot use web-cache as the file name.
Before changing the Web cache directory, you must disable Web caching. After changing the Web cache directory, enable Web caching again.
You must specify a directory on the slot same as the backup Web caching slot specified by using the backup command.
Examples
# (In standalone mode.) Set the backup Web cache directory.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] file-directory backup slot4#flash:/webcache
# (In IRF mode.) Set the backup Web cache directory.
<Sysname> system-view
[Sysname] web-cache chassis 2 slot 1
[Sysname-web-cache-chassis2-slot1] file-directory backup chassis2#slot4#flash:/webcache
Related commands
backup
http enable
Use http enable to enable HTTP-based Web caching.
Use undo http enable to disable HTTP-based Web caching.
Syntax
http enable
undo http enable
Default
HTTP-based Web caching is disabled.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Usage guidelines
Before enabling HTTP-based Web caching, you must configure the types of the webpage files to be cached and the Web cache directory.
Examples
# (In standalone mode.) Enable HTTP-based Web caching.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] http enable
# (In IRF mode.) Enable HTTP-based Web caching.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] http enable
Related commands
cached-data
file-directory
listen-port
https enable
Use https enable to enable HTTPS-based Web caching.
Use undo https enable to disable HTTP-based Web caching.
Syntax
https enable
undo https enable
Default
HTTPS-based Web caching is disabled.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Usage guidelines
Before enabling HTTPS-based Web caching, you must configure the types of the webpage files to be cached and the Web cache directory.
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.
Examples
# (In standalone mode.) Enable HTTPS-based Web caching.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] https enable
# (In IRF mode.) Enable HTTPS-based Web caching.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] https enable
Related commands
file-directory
cached-data
https listen-port
Use https listen-port to set a port number for Web caching to listen for HTTPS packets.
Use undo https listen-port to remove listening port numbers specified for Web caching to listen for HTTPS packets.
Syntax
https listen-port port-number [ server-port server-port-number ]
undo https listen-port [ port-number ]
Default
Web caching listens to port 2043 for HTTPS packets.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Parameters
port-number: Specifies a TCP port number for Web caching to listen for HTTPS packets (HTTPS listening port number for Web caching). The value range is 1025 to 65535.
server-port server-port-number: Specifies the listening port number of the Web server from which Web caching caches Web content. The value range is 1 to 65535, and the default is 443.
Usage guidelines
Use this command in either of the following situations:
· A port number used by Web caching to listen for 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 HTTPS packets on port number 443.
After receiving an HTTPS request from a host, Web cache first checks whether the destination port number in the request matches an HTTPS listening port number of a Web server. If yes, Web caching replaces the destination port number with the listening port number of the Web server and forwards the request to the Web server. Upon receiving the HTTPS response from the Web server, Web caching replaces the source port number with the listening port number for Web caching before sending the response to the host.
An HTTPS listening port number for Web caching and an HTTPS listening port number for a Web server is a listening port number pair. 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 maximum of eight pairs are supported.
Before changing the listening port setting, you must disable Web caching. After changing the listening port setting, enable Web caching again.
Make sure the specified TCP port numbers are not being used and will not be used by any other services on the device. To display TCP port numbers in use, execute the display tcp verbose command.
If a TCP port number has been specified as an HTTPS listening port number, you cannot specify it as an HTTP listening port number, and vice versa.
If you execute this command multiple times with the same Web caching listening port number or Web server caching listening port number, the most recent configuration takes effect.
Examples
# (In standalone mode.) Set the port number to 1655 for Web caching to listen for HTTPS packets.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] https listen-port 1655
# (In standalone mode.) Set the port number to 1655 for Web caching to listen for HTTPS packets destined for the Web server that uses the listening port number 8655.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] https listen-port 1655 server-port 8655
Related commands
https enable
listen-port
Use listen-port to set a port number for Web caching to listen for HTTP packets.
Use undo listen-port to remove listening port numbers specified for Web caching to listen for HTTP packets.
Syntax
listen-port port-number [ server-port server-port-number ]
undo listen-port [ port-number ]
Default
Web caching listens to port 4180 for HTTP packets.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Parameters
port-number: Specifies a TCP port number for Web caching to listen for HTTP packets (HTTP listening port number for Web caching). The value range is 1025 to 65535.
server-port server-port-number: Specifies the listening port number of the Web server from which Web caching caches Web content. The value range is 1 to 65535, and the default is 80.
Usage guidelines
Use this command in either of the following situations:
· A port number used by Web caching to listen for HTTP 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.
After receiving an HTTP request from a host, Web cache first checks whether the destination port number in the request matches an HTTP listening port number of a Web server. If yes, Web caching replaces the destination port number with the listening port number of the Web server and forwards the request to the Web server. Upon receiving the HTTP response from the Web server, Web caching replaces the source port number with the listening port number for Web caching before sending the response to the host.
An HTTP listening port number for Web caching and an HTTP listening port number for a Web server is a listening port number pair. 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 maximum of eight pairs are supported.
Before changing the listening port setting, you must disable Web caching. After changing the listening port setting, enable Web caching again.
Make sure the specified TCP port numbers are not being used and will not be used by any other services on the device. To display TCP port numbers in use, execute the display tcp verbose command.
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.
If you execute this command multiple times with the same Web caching listening port number or Web server caching listening port number, the most recent configuration takes effect.
Examples
# (In standalone mode.) Set the port number to 1655 for Web caching to listen for HTTP packets.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] listen-port 1655
# (In standalone mode.) Set the port number to 1655 for Web caching to listen for HTTP packets destined for the Web server that uses the listening port number 8655.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] listen-port 1655 server-port 8655
Related commands
http enable
object-group
Use object-group to specify an IP address object group used to filter Web content.
Use undo object-group to remove an IP address object group used to filter Web content.
Syntax
object-group [ exclude ] [ source ] { ip | ipv6 } object-group-name
undo object-group [ exclude ] [ source ] { ip | ipv6 }
Default
No IP address object group is specified for filtering Web content. The Web caching feature caches webpage content from all Web servers.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Parameters
exclude: Forbids caching Web content requested by Web clients or sent from Web servers specified by the object group. If you do not specify this keyword, the Web caching feature caches Web content requested by Web clients or sent from Web servers specified by the object group.
source: Caches Web content requested by specific Web clients. If you do not specify this keyword, the Web caching feature caches Web content from specific Web servers.
ip: Uses an IPv4 address object group to specify Web clients or Web servers.
ipv6: Uses an IPv6 address object group to specify Web clients or Web servers.
object-group-name: Specifies an IP address object group by its name, a case-insensitive string of 1 to 63 characters.
Usage guidelines
Operating mechanism
The filtering mechanism varies by the keywords specified when you execute the object-group command.
· If you specify both the exclude and source keywords, Web caching does not cache Web content requested by Web clients specified by the object group.
· If you specify only the exclude keyword, Web caching does not cache Web content sent from Web servers specified by the object group.
· If you specify only the source keyword, Web caching caches Web content requested by only Web clients specified by the object group.
· If you specify neither the exclude nor the source keyword, Web caching caches Web content sent from only Web servers specified by the object group.
Restrictions and guidelines
If you execute this command multiple times with the same Web content type but different object groups, the most recent configuration takes effect.
Before you edit the configuration of the object-group command, you must disable Web caching. After editing the configuration, enable Web caching again.
To configure both the object-group and object-group exclude commands, do not specify the same IP address object group.
Examples
# (In standalone mode.) Configure the Web caching feature to cache only Web content from Web servers specified by IPv4 address object group aaa.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] object-group ip aaa
# (In IRF mode.) Configure the Web caching feature to cache only Web content from Web servers specified by IPv4 address object group aaa.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] object-group ip aaa
# (In standalone mode.) Configure the Web caching feature not to cache Web content requested by Web clients specified by IPv4 address object group aaa.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] object-group exclude source ip aaa
# (In IRF mode.) Configure the Web caching feature not to cache Web content requested by Web clients specified by IPv4 address object group aaa.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] object-group exclude source ip aaa
Related commands
object-group (Security Command Reference)
querystring-file-cache enable
Use querystring-file-cache enable to enable Web caching for files in QueryString of a URL.
Use undo querystring-file-cache enable to disable Web caching for files in QueryString of a URL.
Syntax
querystring-file-cache enable
undo querystring-file-cache enable
Default
Web caching does not cache files in QueryString of a URL.
Views
Web cache view
Predefined user roles
network-admin
mdc-admin
Usage guidelines
After you execute this command, Web caching can cache files in QueryString of a URL, and it determines whether to cache the files according to other file filtering rules.
Examples
# (In standalone mode.) On slot 1, enable Web caching to cache files in QueryString of a URL.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] querystring-file-cache enable
Related commands
cached-data
cached-extension-name
cached-file
web-cache
Use web-cache to create a Web cache view and enter its view, or enter an existing Web cache view.
Use undo web-cache to delete a Web cache view and all settings in the view.
Syntax
In standalone mode:
web-cache slot slot-number
undo web-cache slot
In IRF mode:
web-cache chassis chassis-number slot slot-number
undo web-cache chassis
Default
No Web cache views exist.
Views
System view
Predefined user roles
network-admin
mdc-admin
Parameters
slot slot-number: Specifies a card by its slot number. (In standalone mode.)
chassis chassis-number slot slot-number: Specifies a card on an IRF member device. The chassis-number argument represents the member ID of the IRF member device. The slot-number argument represents the slot number of the card. (In IRF mode.)
Examples
# (In standalone mode.) Create a Web cache view and enter its view.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1]
# (In IRF mode.) Create a Web cache view and enter its view.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1]