Giter Club home page Giter Club logo

Comments (15)

rs avatar rs commented on May 16, 2024 9

The caching part is planned. Prefetching might be tricky to do right, and I doubt an unbound-like prefetch would benefit local LAN without enough clients to amortize it. A knot-resolver type of prefetch with prediction could be interesting, but far more complex.

We'll start with simple caching :)

from nextdns.

rs avatar rs commented on May 16, 2024 2

Fixed by 0e2dc7a. Please play the new cache-size configuration option.

from nextdns.

lunim avatar lunim commented on May 16, 2024

How long are results cached for?

If the whitelist/blacklist is updated is the cache cleared? If not, it might be handy to have the client invalidate the cache if a configuration change is made.

from nextdns.

rs avatar rs commented on May 16, 2024

It is an AST cache, it will keep the most popular entries until the size of the cache is reached, replacing least popular entries by new ones then. When a query is performed, if the minimum TTL of the cached entry is still valid, the entry is used, otherwise, a request is performed to the upstream. If the upstream can't be reached, the stale cache entry is used instead of returning a SERVFAIL.

Blocked entries have a TTL of 5 min set by NextDNS, they will then be invalidated after 5 min. Note that your OS is also performing the same kind of caching, so clearing one cache and not the other won't have much effect.

from nextdns.

FernandoMiguel avatar FernandoMiguel commented on May 16, 2024

@rs -cache-size is in byte size, not TTL?
I would prefer to say to cache 30 seconds , for example

from nextdns.

rs avatar rs commented on May 16, 2024

Please read my message above.

It does not make sense to force the eviction of a cached entry if there is still space available in the cache. Those entries can be useful in case of upstream reachability issue. The AST eviction algorithm will make sure that least popular entries give up space for most popular ones.

from nextdns.

gam-phon avatar gam-phon commented on May 16, 2024

Great work. This is great, thank you so much for providing this feature.

I have a question since cache will depends on original TTL for unblocked by NEXTDNS dashboard. If there is a website that has TTL for 1 year for example and already cached in the client of NEXTDNS then later from NEXTDNS dashboard I have blocked it by category or specifically. I think it will not be blocked until it got purged from NEXTDNS client, right?

from nextdns.

Fail-Safe avatar Fail-Safe commented on May 16, 2024

@rs I am thrilled to see the progress on this! Many thanks!

I did log two new issues based on testing I have been doing. If you would prefer I log issues in this thread instead of opening new issues, let me know and I will move the details over to this thread.

from nextdns.

rs avatar rs commented on May 16, 2024

@gam-phon that is correct. We can provide a max-ttl option to cap the TTL of entries to workaround that.

from nextdns.

rs avatar rs commented on May 16, 2024

@Fail-Safe new issues are better.

from nextdns.

lunim avatar lunim commented on May 16, 2024

Blocked entries have a TTL of 5 min set by NextDNS, they will then be invalidated after 5 min. Note that your OS is also performing the same kind of caching, so clearing one cache and not the other won't have much effect.

Thanks for the update. I've noticed that devices on my network respond much faster than 5 minutes when unblocking a site. Does restarting the NextDNS client flush the cache?

from nextdns.

rs avatar rs commented on May 16, 2024

Our clients flushes the DNS cache of the host yes. It's actually a side effect, but a convenient one.

from nextdns.

jwelter1971 avatar jwelter1971 commented on May 16, 2024

Any way to get statistics of how the cache is performing?

from nextdns.

rs avatar rs commented on May 16, 2024

Yes, can you open a ticket?

from nextdns.

jwelter1971 avatar jwelter1971 commented on May 16, 2024

Done, see #154

from nextdns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.