Skip to content

lua: resurrect cache.clear('name')

Vladimír Čunát requested to merge restore-cache-ops into master

(Continuation of https://gitlab.labs.nic.cz/knot/knot-resolver/merge_requests/583)

See the caveats described in docs.

Further suggestions

  • For both functions we might add support to only consider exact name matches instead of subtrees, e.g. via optionally passing true as second parameter.

cache.clear():

  • The return values are inconsistent. Proposal (slightly incompatible change): even if called without parameters, we return the number of removed records or a negative number on error (instead of bool).
  • We may add code doing asynchronous larger purges as suggested in docs.

cache.get():

  • Recognize CNAME and DNAME.
  • true doesn't allow to distinguish unvalidated negative records or outdated records. We might e.g. output something more useful than true.
Edited by Vladimír Čunát

Merge request reports

Loading