File: cache.lua.j2

package info (click to toggle)
knot-resolver 6.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 16,392 kB
  • sloc: javascript: 42,732; ansic: 40,312; python: 12,616; cpp: 2,121; sh: 1,997; xml: 193; makefile: 181
file content (32 lines) | stat: -rw-r--r-- 946 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
cache.open({{ cfg.cache.size_max.bytes() }}, 'lmdb://{{ cfg.cache.storage }}')
cache.min_ttl({{ cfg.cache.ttl_min.seconds() }})
cache.max_ttl({{ cfg.cache.ttl_max.seconds() }})
cache.ns_tout({{ cfg.cache.ns_timeout.millis() }})

{% if cfg.cache.prefill %}
-- cache.prefill
modules.load('prefill')
prefill.config({
{% for item in cfg.cache.prefill %}
    ['{{ item.origin.punycode() }}'] = {
        url = '{{ item.url }}',
        interval = {{ item.refresh_interval.seconds() }},
        {{ "ca_file = '" + item.ca_file|string + "'," if item.ca_file }}
    }
{% endfor %}
})
{% endif %}

{% if cfg.cache.prefetch.expiring %}
-- cache.prefetch.expiring
modules.load('prefetch')
{% endif %}

{% if cfg.cache.prefetch.prediction.enable %}
-- cache.prefetch.prediction
modules.load('predict')
predict.config({
    window = {{ cfg.cache.prefetch.prediction.window.minutes() }},
    period = {{ cfg.cache.prefetch.prediction.period }},
})
{% endif %}