info_i_25x25.png See important information about Ubiquiti Devices and KRACK Vulnerability in this article. We will update this document as more information becomes available.

EdgeRouter - Configure Web Cache

Web Caching - CLI Commands

 

To set up web caching, use the following commands:

set service webproxy listen-address <ip address>
set service webproxy cache-size <size>
set service webproxy mem-cache-size <size>

To view the available statistics add a listen-address on the loopback address and use the squidclient mgr:info command:

 configure
 set service webproxy listen-address 127.0.0.1
 commit
 save
 exit

 ubnt@sj-lab:~$ squidclient mgr:info
 HTTP/1.0 200 OK
 Server: squid/3.1.6
 Mime-Version: 1.0
 Date: Mon, 29 Oct 2012 23:24:01 GMT
 Content-Type: text/plain
 Expires: Mon, 29 Oct 2012 23:24:01 GMT
 Last-Modified: Mon, 29 Oct 2012 23:24:01 GMT
 X-Cache: MISS from localhost
 X-Cache-Lookup: MISS from localhost:3128
 Via: 1.0 localhost (squid/3.1.6)
 Proxy-Connection: close
 Squid Object Cache: Version 3.1.6
 Start Time:	Mon, 29 Oct 2012 23:22:05 GMT
 Current Time:	Mon, 29 Oct 2012 23:24:01 GMT
 <SNIP>
 Cache information for squid:
 Hits as % of all requests:	5min: 0.0%, 60min: 0.0%
 Hits as % of bytes sent:	5min: 30.8%, 60min: 30.8%
 Memory hits as % of hit requests:	5min: 0.0%, 60min: 0.0%
 Disk hits as % of hit requests:	5min: 0.0%, 60min: 0.0%
 Storage Swap size:	0 KB
 Storage Swap capacity:	 0.0% used,  0.0% free
 Storage Mem size:	104 KB
 Storage Mem capacity:	 0.0% used,  0.0% free
 Mean Object Size:	0.00 KB
 Requests given to unlinkd:	0
 <SNIP>

 

info_i_25x25.png Note: All 'set' commands in EdgeOS can be removed from the configuration by replacing  'set' with a 'delete' statement.