A Content Delivery Network (CDN) is a system of distributed servers located around the world that work together to deliver web content to users more efficiently.
The main goal of a CDN is to reduce latency and improve the speed, reliability, and security of content delivery. Instead of serving content from a single origin server, a CDN caches and delivers static assets (like images, stylesheets, scripts, and videos) from servers that are geographically closer to the user.
When a user accesses a website:
If your website is hosted in Germany and a visitor from Japan accesses it, the CDN will serve cached content from a server in Japan, making the site load much faster for that user.
Second Life uses a Content Delivery Network (CDN) to distribute texture and mesh data more efficiently across the globe. This shift from simulator-based delivery to CDN-based delivery has brought several key improvements to the platform.
β’ Improved resilience during traffic spikes or outages. β’ Faster recovery from load-related issues thanks to CDN redundancy and optimizations.
The integration of CDN technology into Second Life has: β’ Enhanced user experience through faster asset loading β’ Reduced strain on core infrastructure β’ Enabled more scalable and reliable virtual environments
This guide explains how to monitor Squid proxy logs in real time, edit its configuration file, and includes a sample shell script for setting up a test directory.
To monitor Squid activity in real time, use the following command:
sudo tail -f /var/log/squid/access.log /var/log/squid/cache.log
This will continuously display new entries from: β’ access.log β records client requests β’ cache.log β logs cache behavior and errors
To edit Squidβs main configuration file, run:
sudo nano /etc/squid/squid.conf
Example config:
http_port 192.168.0.43:1234 #the machine this is running on # http_port 127.0.0.1:1234 cache_dir aufs /var/spool/squid/slcdn-cache 100000 16 256 cache_mem 1024 MB maximum_object_size 1024 MB maximum_object_size_in_memory 50 MB minimum_object_size 0 KB cache_log /var/log/squid/cache.log access_log daemon:/var/log/squid/access.log cache_store_log /var/log/squid/store.log acl localnet src 192.168.0.0/24 # http_access allow localnet http_access allow all cache allow all refresh_pattern . 43200 100% 43200 range_offset_limit -1 collapsed_forwarding on
Inside , you can define the paths for Squidβs log files:
β’ : logs cache-related events β’ : logs client access (via daemon) β’ : logs stored objects
Hereβs a simple Bash script to create a test directory:
To run the script run the command:
wget https://mond-keks.de/downloads/SLEdgeCDN.sh SLEdgeCDN.sh chmod +x SLEdgeCDN.sh ./SLEdgeCDN.sh
#!/bin/bash
set -e
BASE="$HOME/Desktop/SL_CDN_TEST"
echo "=== SL CDN Installer ==="
# install squid if not installed
if ! command -v squid >/dev/null 2>&1; then
if [ -f /etc/debian_version ]; then
sudo apt update && sudo apt install -y squid
elif [ -f /etc/fedora-release ]; then
sudo dnf install -y squid
elif [ -f /etc/arch-release ]; then
sudo pacman -Sy --noconfirm squid
else
echo "Your distro isnβt supported. Install squid manually."
exit 1
fi
fi
# backup old squid.conf
sudo cp /etc/squid/squid.conf /etc/squid/squid.conf.bak.$(date +%s) || true
# write new config
sudo tee /etc/squid/squid.conf >/dev/null <<EOF
http_port 127.0.0.1:1234
cache_dir aufs /var/spool/squid/slcdn-cache 100000 16 256
cache_mem 1024 MB
maximum_object_size 1024 MB
maximum_object_size_in_memory 50 MB
minimum_object_size 0 KB
cache_log /var/log/squid/cache.log
access_log daemon:/var/log/squid/access.log
cache_store_log /var/log/squid/store.log
acl localnet src 127.0.0.1/32
http_access allow localnet
http_access deny all
cache allow all
refresh_pattern . 43200 100% 43200
range_offset_limit -1
collapsed_forwarding on
EOF
# make cache and log dirs
sudo mkdir -p /var/spool/squid/slcdn-cache /var/log/squid
sudo chown -R proxy:proxy /var/spool/squid /var/log/squid
sudo squid -z
# restart squid
sudo systemctl restart squid
# reset desktop control folder
rm -rf "$BASE"
mkdir -p "$BASE"
# main control script
cat > "$BASE/slcdn.sh" <<'EOS'
#!/bin/bash
LOG=$HOME/Desktop/SL_CDN_TEST/proxy.log
start() { echo "Starting Squid..." | tee -a "$LOG"; sudo systemctl start squid; }
stop() { echo "Stopping Squid..." | tee -a "$LOG"; sudo systemctl stop squid; sudo killall -9 squid 2>/dev/null || true; sudo rm -f /run/squid.pid; }
restart() { echo "Restarting Squid..." | tee -a "$LOG"; stop; sudo squid -z || true; start; }
status() { echo "Squid status:" | tee -a "$LOG"; sudo systemctl status squid --no-pager -l; }
case "$1" in start|stop|restart|status) "$1";; *) echo "Usage: $0 {start|stop|restart|status}";; esac
EOS
chmod +x "$BASE/slcdn.sh"
# clear cache script
cat > "$BASE/slcdn-clear.sh" <<'EOS'
#!/bin/bash
echo "Clearing Squid cache..."
sudo systemctl stop squid || true
sudo killall -9 squid 2>/dev/null || true
sudo rm -f /run/squid.pid
sudo rm -rf /var/spool/squid/slcdn-cache
sudo mkdir -p /var/spool/squid/slcdn-cache
sudo chown -R proxy:proxy /var/spool/squid/slcdn-cache
sudo squid -z
echo "Cache cleared. Restart Squid to refill."
EOS
chmod +x "$BASE/slcdn-clear.sh"
# desktop shortcuts
make_launcher () {
local name="$1" cmd="$2" term="$3"
cat > "$BASE/SLCDN-$name.desktop" <<EOD
[Desktop Entry]
Name=SL CDN $name
Exec=$cmd
Icon=utilities-terminal
Terminal=$term
Type=Application
EOD
chmod +x "$BASE/SLCDN-$name.desktop"
}
make_launcher "Start" "$BASE/slcdn.sh start" true
make_launcher "Stop" "$BASE/slcdn.sh stop" true
make_launcher "Restart" "$BASE/slcdn.sh restart" true
make_launcher "Status" "$BASE/slcdn.sh status" true
make_launcher "Clear" "$BASE/slcdn-clear.sh" true
make_launcher "Cache" "xdg-open /var/spool/squid/slcdn-cache" false
make_launcher "Debug" "gnome-terminal -- bash -c \"sudo tail -f /var/log/squid/access.log\"" false
echo "Done. Set Firestorm proxy to 127.0.0.1 port 1234"
This script creates a folder on the userβs desktop and can be extended for further setup tasks.
so start or restart squid
sudo systemctl restart squid sudo systemctl start squid sudo systemctl stop squid