It is possible to use FreeBSD’s MFS Memory Disk to speed up access times of cached web objects.
The md driver provides support for four kinds of memory backed virtual disks:
Backing store is allocated from buffer memory. Pages get pushed out to the swap when the system is under memory pressure, otherwise they stay in the operating memory. Using swap backing is generally preferable over malloc backing.
Chromium’s cache is at
$HOME/.cache/chromium, and so, my
-s256mspecifies a memory reservation of 256 M;
-wootput:ootputhands ownership of the mountpoint from root to the user; and
noautoprevents the system from failing to boot properly if the mountpoint does not (yet) exist.
The following additions to
/etc/rc.conf were also made:
which lists arguments to
mdconfig(8) for device
At mininum the
-t type must be specified and either a
-s size for malloc or swap backed
md(4) devices or a
-f file for vnode backed
The redundancies found in
rc.conf allows automatic mounting at boot, or manual mounting after boot.
To test the changes made, as root:
# /etc/rc.d/mdconfig restart
On to the
$USER/bin/pack_chrome executable script that will both mount the
md device, and/or sync contents from the cache at RAM to a backup cache on the HDD:
The script requires that the
$USER is in
sudoers(5), and is able to use the
$ crontab -e:
.. and the script gets called every half-hour by
cron to automate the syncing process. This also requires that
$USER is specifically allowed in