Caching proxy w/ polipo (part1)

Let's see if we can (at least make it seem like) web browsing is faster...
(i'm still not sure whether installing SQM was an improvement)

I chose polipo as it is geared to home use and is supposedly easier to deal with than squid.
And it comes with its own luci app so install is dead easy
install luci-app-polipo
defaults looked sensible, so I just directed my browser to use router.lan:8123 as proxy, and presto - things indeed 'feel' faster. A check with chrome didn't reveal a significant decrease in load time though - 11.9s vs 11, even on a reload... but in this case the log showed a lot of cache directives not being recognized by polipo.
! there might be an issue with the resolver and local hostnames (openwrt.lan) but not sure yet.

Anyhoo, so let's add some storage for polipo to use so everything won't have to go in RAM.
Apparently ext4 is the better filesystem for wrt so let's prepare a usb stick for that.
(sudo)
fdisk -l -> check where your stick is at e.g. /dev/sdb1
fdisk /dev/sdb1
d (delete) n (new) p (primary) 1 (first partition) - accept the defaults - w (write)
mkfs.ext4 /dev/sdb1
some black magic that is supposed to make things faster by switching off journaling (wich should make the first line redundant IMO)(something fishy with -o vs -O as well)
tune2fs -o +journal_data_writeback /dev/sdb1
tune2fs -O +has_journal /dev/sdb1
tune2fs -m 0 /dev/sdx1

Last line doesn't reserve space for priviliged processes.
Then just mount the stick via luci system>mount points>add
and point polipo to the same location service>polipo>logging and ram>on-disk cache.
Apparently there's no limit setting for the size used, only how quickly files should be deleted. let's keep our fingers crossed. :)

next, we should point all our http traffic to our proxy.
hardcore way is to use iptables to redirect anything from lan with dport 80 to port 8123. But that makes it impossible for a user to decide whether to use the proxy or not - not so smart when we're still just trying things out.... part2 soon on dhcp/wpad/pac file.



Comments

Popular posts from this blog

Traffic accounting

QoS with SQM (and something about bufferbloat)

Ath10k alternative driver firmware - CC15.05.1 wireless unstable