- Table of Contents
-
- 07-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-IRDP commands
- 12-IP performance optimization commands
- 13-UDP helper commands
- 14-IPv6 basics commands
- 15-DHCPv6 commands
- 16-IPv6 fast forwarding commands
- 17-AFT commands
- 18-Tunneling commands
- 19-GRE commands
- 20-ADVPN commands
- 21-WAAS commands
- 22-Web caching commands
- Related Documents
-
Title | Size | Download |
---|---|---|
22-Web caching commands | 76.48 KB |
Web caching commands
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
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.
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
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
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 specified maximum total size for Web cache files must be less 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 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 contents in a Web cache file, it restarts the aging timer. If no users request the contents 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
Parameters
history: Displays history information. If you do not specify this keyword, the command displays the current statistics, which is collected at 1-second intervals.
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 history 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. |
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 |
Reduced bandwidth 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. |
file-directory
Use file-directory to set the Web cache directory.
Use undo file-directory to restore the default.
Syntax
file-directory directory
undo file-directory
Default
The Web cache directory is not set.
Views
Web cache view
Predefined user roles
network-admin
Parameters
directory: Specifies the 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 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 contents 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 Web cache directory for a Web cache view must reside on the same slot as the Web view.
Examples
# (In standalone mode.) Set the 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 Web cache directory.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] file-directory chassis1#slot1#flash:/aaa
http enable
Use http enable to enable Web caching.
Use undo http enable to disable Web caching.
Syntax
http enable
undo http enable
Default
Web caching is disabled.
Views
Web cache view
Predefined user roles
network-admin
Usage guidelines
Before enabling Web caching, you must configure the following Web caching parameters:
· Types of the webpage files to be cached.
· Web cache directory.
· Web caching listening port number.
Examples
# (In standalone mode.) Enable Web caching.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] http enable
# (In IRF mode.) Enable Web caching.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] http enable
Related commands
cached-data
listen-port
listen-port
Use listen-port to specify the Web caching listening port number.
Use undo listen-port to restore the default.
Syntax
listen-port port-number
undo listen-port
Default
The Web caching listening port number is 80.
Views
Web cache view
Predefined user roles
network-admin
Parameters
port-number: Specifies a TCP port number in the range of 1 to 65535.
Usage guidelines
If you do not specify the Web caching listening port number, the Web caching feature does not operate.
Make sure the specified TCP port number is not being used by any other services on the device. To display TCP port numbers being used, execute the display tcp verbose command.
Execute this command before enabling Web caching.
Before changing the listening port setting, you must disable Web caching. After changing the listening port setting, enable Web caching again.
Examples
# (In standalone mode.) Set the Web caching listening port number to 655.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] listen-port 655
# (In IRF mode.) Set the Web caching listening port number to 655.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] listen-port 655
Related commands
http enable
object-group
Use object-group to specify an IPv4 object group used to filter Web content to be cached.
Use undo object-group to remove an IPv4 object group used to filter Web content to be cached.
Syntax
object-group [ source ] ip object-group-name
undo object-group [ source ]
Default
No IPv4 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
Parameters
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 object group to specify Web clients or Web servers. For more information about IPv4 object groups, see Security Configuration Guide.
object-group-name: Specifies an IPv4 object group by its name, a case-insensitive string of 1 to 31 characters.
Usage guidelines
Use this command to configure the Web caching feature to cache only Web content requested by specific Web clients or sent from specific Web servers.
This command requires the cooperation of the IPv4 object group feature. For more information about the IPv4 object group feature, see object group configuration in Security Configuration Guide.
Execute this command before enabling Web caching.
Before changing the IPv4 object group setting, you must disable Web caching. After changing the IPv4 object group setting, enable Web caching again.
Examples
# (In standalone mode.) Configure the Web caching feature to cache only Web content from Web servers specified by IPv4 object group aaa.
<Sysname> system-view
[Sysname] web-cache slot 1
[Sysname-web-cache-slot1] object-group aaa
# (In IRF mode.) Configure the Web caching feature to cache only Web content from Web servers specified by IPv4 object group aaa.
<Sysname> system-view
[Sysname] web-cache chassis 1 slot 1
[Sysname-web-cache-chassis1-slot1] object-group aaa
Related commands
object-group (Security Command Reference)
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
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]