With a global user base and terabytes of transfer per month, I saw that the OpenWrt downloads area could really benefit from a content delivery network (CDN).
Therefore, I have gotten in touch with jsDelivr to set up a CDN for the OpenWrt downloads area.
jsDelivr is an awesome initiative that provides CDNs for open-source projects, including CocoaPods, Pyodide, and now OpenWrt. They combine multiple CDN and DNS providers, including Cloudflare, Bunny, and Fastly, to create a CDN that is the fastest of its kind.
Below is the exact setup for the CDN and how to use it, as described by the jsDelivr team.
-
Stables releases
- Format: https://cdn.jsdelivr.net/openwrt/downloads/file
- Sample: https://cdn.jsdelivr.net/openwrt/downloads/releases/22.03.3/targets/apm821xx/nand/openwrt-22.03.3-apm821xx-nand-meraki_mr24-initramfs-kernel.bin
- Caching: 20 minutes for now, we’ll change it to 1 year when you confirm everything works correctly.
-
Snapshots
- Format: https://cdn.jsdelivr.net/openwrt/downloads/file
- Sample: https://cdn.jsdelivr.net/openwrt/downloads/snapshots/targets/apm821xx/nand/openwrt-apm821xx-nand-meraki_mr24-initramfs-kernel.bin
- Caching: 10 minutes for now, we’ll change it to 1 day when you confirm everything works correctly.
-
Archive
- Format: https://cdn.jsdelivr.net/openwrt/archive/file
- Sample: https://cdn.jsdelivr.net/openwrt/archive/releases/22.03.2/targets/apm821xx/nand/openwrt-22.03.2-apm821xx-nand-meraki_mr24-initramfs-kernel.bin
- Caching: 60 minutes for now, we’ll change it to 1 year when you confirm everything works correctly.
To use in opkg, replace downloads.openwrt.org with cdn.jsdelivr.com/openwrt/downloads in /etc/opkg/distfeeds.conf
. Example:
src/gz openwrt_core https://cdn.jsdelivr.net/openwrt/downloads/releases/22.03.2/targets/ramips/mt7621/packages
src/gz openwrt_base https://cdn.jsdelivr.net/openwrt/downloads/releases/22.03.2/packages/mipsel_24kc/base
src/gz openwrt_luci https://cdn.jsdelivr.net/openwrt/downloads/releases/22.03.2/packages/mipsel_24kc/luci
src/gz openwrt_packages https://cdn.jsdelivr.net/openwrt/downloads/releases/22.03.2/packages/mipsel_24kc/packages
src/gz openwrt_routing https://cdn.jsdelivr.net/openwrt/downloads/releases/22.03.2/packages/mipsel_24kc/routing
src/gz openwrt_telephony https://cdn.jsdelivr.net/openwrt/downloads/releases/22.03.2/packages/mipsel_24kc/telephony
KeyCDN performance tests:
- jsDelivr CDN: https://tools.keycdn.com/performance?url=https://cdn.jsdelivr.net/openwrt/downloads/releases/22.03.3/targets/ath79/mikrotik/packages/Packages
- Origin: https://tools.keycdn.com/performance?url=https://downloads.openwrt.org/releases/22.03.3/targets/ath79/mikrotik/packages/Packages
Note that this a 'proxy' CDN, not a 'bucket' CDN. This means that initial downloads will be from the downloads.openwrt.org origin, and subsequent downloads of the same file will be from the global cache (for the duration of the cache).
In a later stage, the OpenWrt team could consider placing the files directly on the bucket as opposed to proxying from the origin.
Let me know what you think.