diff options
author | 2016-04-19 11:13:24 +0100 | |
---|---|---|
committer | 2016-04-19 11:13:24 +0100 | |
commit | 10db2a80df36b3d64b0b62644c91420046d827f8 (patch) | |
tree | fe34032ddd44a8a9318cbcd256afed10222dbe32 /middleware/loadbalance/handler.go | |
parent | 4e3c82bec56782a63fd3a503bcc4859a62020893 (diff) | |
download | coredns-10db2a80df36b3d64b0b62644c91420046d827f8.tar.gz coredns-10db2a80df36b3d64b0b62644c91420046d827f8.tar.zst coredns-10db2a80df36b3d64b0b62644c91420046d827f8.zip |
Cache (#126)
* 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
Diffstat (limited to 'middleware/loadbalance/handler.go')
-rw-r--r-- | middleware/loadbalance/handler.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/middleware/loadbalance/handler.go b/middleware/loadbalance/handler.go index bb8619543..119b4d5d2 100644 --- a/middleware/loadbalance/handler.go +++ b/middleware/loadbalance/handler.go @@ -3,6 +3,7 @@ package loadbalance import ( "github.com/miekg/coredns/middleware" + "github.com/miekg/dns" "golang.org/x/net/context" ) @@ -12,7 +13,7 @@ type RoundRobin struct { Next middleware.Handler } -// ServeHTTP implements the middleware.Handler interface. +// ServeDNS implements the middleware.Handler interface. func (rr RoundRobin) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) { wrr := NewRoundRobinResponseWriter(w) return rr.Next.ServeDNS(ctx, wrr, r) |