<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Caching on Miek Gieben</title>
    <link>https://miek.nl/tags/caching/</link>
    <description>Recent content in Caching on Miek Gieben</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <copyright>© Copyright 2007-2024 Miek Gieben</copyright>
    <lastBuildDate>Wed, 20 Apr 2016 07:54:08 +0100</lastBuildDate>
    <atom:link href="https://miek.nl/tags/caching/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Caching in CoreDNS</title>
      <link>https://miek.nl/2016/april/20/caching-in-coredns/</link>
      <pubDate>Wed, 20 Apr 2016 07:54:08 +0100</pubDate>
      <guid>https://miek.nl/2016/april/20/caching-in-coredns/</guid>
      <description>&lt;p&gt;In the last couple of evenings I&amp;rsquo;ve implemented a &lt;a href=&#34;https://github.com/miekg/coredns/blob/master/middleware/cache/README.md&#34;&gt;caching&#xA;middleware&lt;/a&gt; in CoreDNS. It&#xA;has a only a few knobs and should be simple to use.&lt;/p&gt;&#xA;&lt;p&gt;Take a simple Corefile and add caching, via the &lt;code&gt;cache&lt;/code&gt; directive.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;.:1053 {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    proxy . 8.8.4.4:53&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    cache 10 miek.nl&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    log stdout&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    errors stdout&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Which defines CoreDNS to be a proxy, and &lt;em&gt;only&lt;/em&gt; cache responses for the &lt;code&gt;miek.nl&lt;/code&gt; zone. This&#xA;cache only caches for up to 10 seconds. Lets send some queries and looks at the logs:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
