Faster Request Response

Faster request response: properly set cache TTL, upstream mode, and region selection to reduce first-packet latency and retry rates, significantly improving perceived speed.

Paid users utilize the NullPrivate private service; the DNS request path is as follows:

DNS Request Path

Based on this path, we can analyze the fastest response strategy.

Local Cache Hit

The fastest response is a local cache hit. Because the local cache operates at the memory level, it is extremely fast—only a few microseconds.

This is controlled by the TTL (time to live) value in the DNS response, typically ranging from minutes to hours, indicating that the query result remains valid during this period and does not need to be queried again.

You can set the minimum TTL value in Control Panel -> Settings -> DNS Settings -> DNS Cache Configuration -> Override Minimum TTL. Increasing this value extends cache duration, allowing the system to use the local cache more frequently. A common TTL value is 600 seconds.

However, since this site also provides filtering capabilities, if a service you need is mistakenly blocked by ad rules, you won’t be able to access it immediately even after temporarily disabling encrypted DNS, because the local cache result has been modified by the filtering rules. Therefore, setting it to 60 seconds is a safer value, ensuring that in rare cases users won’t have to wait too long after disabling encrypted DNS due to false blocks.

NullPrivate DNS Server

Currently, the site uses Alibaba Cloud servers located in Hangzhou, which can meet the low-latency needs of most users in the eastern region. As the business grows, more servers will be added nationwide in the future.

Server Cache Hit

By default, each user is allocated 4 MB of DNS cache. Based on experience, this is sufficient for a household. Allowing users to freely modify this setting may result in forced service termination, so the modification entry for this setting has been disabled.

Upstream DNS Server

Since Alibaba Cloud services are used, upstream DNS services also use Alibaba Cloud DNS, which is very fast, typically returning results within a few milliseconds.

Users have three ways to request upstream DNS servers:

  1. Load Balancing: Load balancing is enabled by default, automatically selecting the fastest server to return results.
  2. Parallel Requests: The site does not restrict the use of parallel requests.
  3. Fastest IP Address: Currently a meaningless setting; the modification entry for this setting has been disabled.

Here’s why the “fastest IP address” is meaningless: the fastest IP must be chosen by the actual device accessing the service. When NullPrivate runs in Hangzhou but the user is in Beijing, NullPrivate considers Hangzhou’s IP address the fastest, but in reality, the user accessing a Beijing service is fastest; choosing Hangzhou’s IP address actually increases latency. Therefore, the modification entry for this setting has been disabled. This setting might be useful in a user’s home network but is meaningless in a public service.

Many factors affect network experience, such as server-side bandwidth, network congestion, server load, and network quality. Choosing the fastest IP address does not guarantee the fastest response speed; latency is only one factor, not the sole factor. To prevent users from misconfiguring and degrading service quality, the modification entry for this setting has been disabled.

Rule Filtering

The most commonly used mode is the blacklist list, where users can choose from preset blacklist lists. Blacklist hits use a hash algorithm; regardless of the number of rules, hit time is O(1), so users need not worry about excessive rule volume causing long hit times.

However, rules are calculated and stored in memory. Each user’s service memory usage is limited to 300 MB, which meets the needs of most users. If a user’s rule volume is too large, it may cause insufficient memory, leading to repeated service restarts and service interruption.

Currently, the site has disabled third-party rules to prevent users from introducing excessive rules. Once better restriction methods are available, third-party rules will be reopened.

Summary

To achieve faster request response, users can:

  1. Appropriately increase the minimum TTL value to improve local cache hit rate.
  2. Set an appropriate DNS cache size (preset value).
  3. Choose the geographically closest city to create a service (pending business expansion).
  4. If no overseas access is needed, use load balancing; if overseas access is needed, use parallel requests.
  5. Use blacklist rules suitable for yourself, avoiding introducing excessive rules.