* Add middleware/cache

Add a caching middleware that caches nxdomain, nodata and successful
responses. It differentiates between DNSSEC on normal DNS replies.

Each reply is compress and scrubbed so it will fit the specific client
asking for it.

* first simple test, less exporting of stuff

* more

* Add middleware/cache

Add a caching middleware that caches nxdomain, nodata and successful
responses. It differentiates between DNSSEC on normal DNS replies.

Each reply is compressed and scrubbed so it will fit the specific client
asking for it. The TTL is decremented with the time spend in the cache.
There is syntax that allows you to cap the TTL for all records, no
matter what. This allows for a shortlived cache, just to absorb query
peaks.

+Tests

* cache test infrastructure

* Testing
This commit is contained in:
Miek Gieben 2016-04-19 11:13:24 +01:00
parent 4e3c82bec5
commit 10db2a80df
12 changed files with 566 additions and 12 deletions

View file

@ -5,15 +5,12 @@ import (
"github.com/miekg/coredns/middleware/loadbalance"
)
// Root sets up the root file path of the server.
// Loadbalance sets up the root file path of the server.
func Loadbalance(c *Controller) (middleware.Middleware, error) {
for c.Next() {
// and choosing the correct balancer
// TODO(miek): block and option parsing
}
return func(next middleware.Handler) middleware.Handler {
return loadbalance.RoundRobin{Next: next}
}, nil
return nil, nil
}