Skip to content

v1.2.0

Compare
Choose a tag to compare
@dvdme dvdme released this 26 Nov 00:55
· 20 commits to master since this release
8282e0f
Implement feature state retention plus more

- Stale retention (optional)
  Add new command line option `--rstale-ttl`.
  If set to >0, a record will stay in cache for StaleTTl seconds.
  If TTL expires and all upstream servers are not available, then
  the state record will be served, if it not older than StaleTTL
  seconds.
  Caveat: If the record in cache is older than StaleTTL, it will still
  be served one last time before being removed from cache.

- Only cache non negative (option)
  Boolean flag rcache-non-negative, if set, will only allow positive
  records to be stored in cache. A positive record is a record whose
  client returned with state: NOERROR.

- Fix: EvictRandom was removing all records in cache. Now removed
  only one.

- Use TTL from response (option)
  Boolean flag rcache-ttl-from-resp, if set, will extract the lowest
  TTL from anwsers in response and use that value, for that record,
  if value > rcache-tll, which is a min value here; and if
  value < rcache-ttl-max, which is max value. If value < rcache-tll,
  rcache-tll will be used; if value > rcache-ttl-max, rcache-tll-max
  will be used.

- Add rcache-tll-max (option)
  See point above.

- Add stats endpoint at http://127.0.0.1:8053
  - /ping will ping-pong that stats endpoint
  - /stats will return current stats in JSON format
  - /dump will dump the current cache table - use with
    caution and for debug only as dumping cache can be
    expensive

- Optimize stats declaration, with name in map to avoid code
  duplication