What is the purpose of Java level DNS caching?

I am currently developing an Android project. I doubt rewriting the Java level DNS cache. Through search, I found that we can implement it by calling the functions mentioned below

 System.setProperty( "networkaddress.cache.ttl", "0" );
 System.setProperty( "networkaddress.cache.negative.ttl", "0" );

Based on this, it will cache the name to find the data. I want to know the purpose or impact of this attribute

resolvent:

The purpose is to reduce DNS requests. This can download faster because the IP of the host name is already in the cache

This is a java system property that directly affects the standard network library. It allows you to adjust the DNS cache at the Java level

As all caches, the cache sometimes does not produce the desired effect. For example, the cache is updated when some DNS entries change

I think the value 0 (no cache) or - 1 (persistent cache) is for testing purposes only

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>