<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Nick,</p>
<p><br>
</p>
<p>You could just use :create_if_missing like I do in my cookbook</p>
<p><br>
</p>
<p><a class="moz-txt-link-freetext" href="https://github.com/damm/powerdns/blob/master/recipes/recursor.rb#L11-L14">https://github.com/damm/powerdns/blob/master/recipes/recursor.rb#L11-L14</a></p>
<p>Yes it's still in use.<br>
</p>
<br>
<div class="moz-cite-prefix">On 1/5/17 2:22 AM, Nick Douma wrote:<br>
</div>
<blockquote
cite="mid:278492d7-9047-e8dd-c22a-988cd4524b1f@nekoconeko.nl"
type="cite">
<pre wrap="">Hi,
In December Bert tweeted the thing about the huge amount of packages
downloaded by users.
<a class="moz-txt-link-freetext" href="https://twitter.com/PowerDNS_Bert/status/810468178950320129">https://twitter.com/PowerDNS_Bert/status/810468178950320129</a>
It seems that my servers were responsible for at least part of the
traffic. I'm using Chef 12 with the remote_file resource to
automatically check if a new package is available, and if so, download
and install it:
```
remote_file "#{Chef::Config[:file_cache_path]}/#{pkg}" do
source "#{package_base}/#{pkg}"
action :create
end
```
Chef is by default configured to use ETag and Last-Modified headers to
determine if a file needs to be downloaded based on the file that is
already present on the system.
The Last-Modified header mechanism doesn't seem to work properly. I
wasn't able to determine if this is something on my end (Chef) or your
end (nginx). Regardless, the following addition disables the
Last-Modified checking and just uses the ETag:
```
remote_file "#{Chef::Config[:file_cache_path]}/#{pkg}" do
source "#{package_base}/#{pkg}"
use_last_modified false
action :create
end
```
This may be of use to other users of Chef and similar systems.
Kind regards,
Nick Douma
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Pdns-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Pdns-users@mailman.powerdns.com">Pdns-users@mailman.powerdns.com</a>
<a class="moz-txt-link-freetext" href="https://mailman.powerdns.com/mailman/listinfo/pdns-users">https://mailman.powerdns.com/mailman/listinfo/pdns-users</a>
</pre>
</blockquote>
<br>
</body>
</html>