Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
96529b2c
Commit
96529b2c
authored
Oct 22, 2018
by
Chris O'Haver
Committed by
GitHub
Oct 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make default min ttl 5 (#2227)
parent
85e5ab77
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
plugin/cache/README.md
plugin/cache/README.md
+2
-2
plugin/cache/cache.go
plugin/cache/cache.go
+2
-2
test/cache_test.go
test/cache_test.go
+1
-1
No files found.
plugin/cache/README.md
View file @
96529b2c
...
...
@@ -40,10 +40,10 @@ cache [TTL] [ZONES...] {
*
**TTL**
and
**ZONES**
as above.
*
`success`
, override the settings for caching successful responses.
**CAPACITY**
indicates the maximum
number of packets we cache before we start evicting (
*randomly*
).
**TTL**
overrides the cache maximum TTL.
**MINTTL**
overrides the cache minimum TTL (default
0
), which can be useful to limit queries to the backend.
**MINTTL**
overrides the cache minimum TTL (default
5
), which can be useful to limit queries to the backend.
*
`denial`
, override the settings for caching denial of existence responses.
**CAPACITY**
indicates the maximum
number of packets we cache before we start evicting (LRU).
**TTL**
overrides the cache maximum TTL.
**MINTTL**
overrides the cache minimum TTL (default
0
), which can be useful to limit queries to the backend.
**MINTTL**
overrides the cache minimum TTL (default
5
), which can be useful to limit queries to the backend.
There is a third category (
`error`
) but those responses are never cached.
*
`prefetch`
will prefetch popular items when they are about to be expunged from the cache.
Popular means
**AMOUNT**
queries have been seen with no gaps of
**DURATION**
or more between them.
...
...
plugin/cache/cache.go
View file @
96529b2c
...
...
@@ -239,9 +239,9 @@ func (w *ResponseWriter) Write(buf []byte) (int, error) {
const
(
maxTTL
=
dnsutil
.
MaximumDefaulTTL
minTTL
=
0
minTTL
=
dnsutil
.
MinimalDefaultTTL
maxNTTL
=
dnsutil
.
MaximumDefaulTTL
/
2
minNTTL
=
0
minNTTL
=
dnsutil
.
MinimalDefaultTTL
defaultCap
=
10000
// default capacity of the cache.
...
...
test/cache_test.go
View file @
96529b2c
...
...
@@ -48,7 +48,7 @@ func TestLookupCache(t *testing.T) {
})
t
.
Run
(
"Short TTL"
,
func
(
t
*
testing
.
T
)
{
testCase
(
t
,
state
,
p
,
"short.example.org."
,
1
,
1
)
testCase
(
t
,
state
,
p
,
"short.example.org."
,
1
,
5
)
})
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment