Writing Efficient Configuration Files
Due to the memory restrictions of iOS Network Extension, Stash may be shut down by iOS due to unreasonable configuration files. In iOS 14, only 15 MB of memory can be used, while in iOS 15+, only 50 MB can be used. Below are some suggestions for writing efficient configuration files.
Stash queries all the DNS servers at the same time and caches DNS queries using the LRU algorithm. On mobile devices, configuring 1-2 DNS servers is sufficient for most use cases.
- DoH, DoT, and DoQ consume more resources and generally have higher latency than traditional UDP-based queries.
- Stash uses a fake IP to avoid local DNS queries for requests that require proxying. For Chinese users, it is recommended to use domestic DNS servers. Configuring foreign DNS services such as 220.127.116.11/18.104.22.168 has no meaning.
For scenarios that require a large number of rules, such as ad blocking or IP geo-based routing, using
domain / ipcidr rule sets can reduce memory usage and improve matching speed.
It is not recommended to use a large number of
classical rule sets, as this
will significantly increase Stash's memory usage.
The HTTP3/QUIC protocol is based on UDP and is inefficient in the current network environment. It is recommended to disable it using Script Shortcuts.
script: shortcuts: # 4483 and 9305 are BiliBili's QUIC CDN quic: network == 'udp' and (dst_port == 443 or dst_port == 4483 or dst_port == 9305) rules: - SCRIPT,quic,REJECT