summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2019-05-24 12:39:37 +0200
committerFrederik Rietdijk <fridh@fridh.nl>2019-05-24 12:39:37 +0200
commit6e4e7c5dc65a3d988437dc2fa73201b8964c8c60 (patch)
treeac550eb4543e2c836f8b298972f26ad9cf093684 /doc
parent7c62ef8685730fcdfbd544bbc5720bf18f13a5fd (diff)
parentc6f7545209676dfa6aef29c2a9c3687b6742e183 (diff)
downloadnixpkgs-6e4e7c5dc65a3d988437dc2fa73201b8964c8c60.tar
nixpkgs-6e4e7c5dc65a3d988437dc2fa73201b8964c8c60.tar.gz
nixpkgs-6e4e7c5dc65a3d988437dc2fa73201b8964c8c60.tar.bz2
nixpkgs-6e4e7c5dc65a3d988437dc2fa73201b8964c8c60.tar.lz
nixpkgs-6e4e7c5dc65a3d988437dc2fa73201b8964c8c60.tar.xz
nixpkgs-6e4e7c5dc65a3d988437dc2fa73201b8964c8c60.tar.zst
nixpkgs-6e4e7c5dc65a3d988437dc2fa73201b8964c8c60.zip
Merge master into staging-next
Diffstat (limited to 'doc')
-rw-r--r--doc/languages-frameworks/haskell.section.md2
-rw-r--r--doc/package-notes.xml48
2 files changed, 49 insertions, 1 deletions
diff --git a/doc/languages-frameworks/haskell.section.md b/doc/languages-frameworks/haskell.section.md
index d832716c030..48d22831cd9 100644
--- a/doc/languages-frameworks/haskell.section.md
+++ b/doc/languages-frameworks/haskell.section.md
@@ -953,7 +953,7 @@ is essentially a "free software" license (BSD3), according to
 paragraph 2 of the LGPL, GHC must be distributed under the terms of the LGPL!
 
 To work around these problems GHC can be build with a slower but LGPL-free
-alternative implemention for Integer called
+alternative implementation for Integer called
 [integer-simple](http://hackage.haskell.org/package/integer-simple).
 
 To get a GHC compiler build with `integer-simple` instead of `integer-gmp` use
diff --git a/doc/package-notes.xml b/doc/package-notes.xml
index 12d81ae29bf..54f3079d554 100644
--- a/doc/package-notes.xml
+++ b/doc/package-notes.xml
@@ -918,4 +918,52 @@ citrix_receiver.override {
    </para>
   </section>
  </section>
+ <section xml:id="sec-nginx">
+  <title>Nginx</title>
+
+  <para>
+    <link xlink:href="https://nginx.org/">Nginx</link> is a
+    reverse proxy and lightweight webserver.
+  </para>
+
+  <section xml:id="sec-nginx-etag">
+   <title>ETags on static files served from the Nix store</title>
+
+   <para>
+     HTTP has a couple different mechanisms for caching to prevent
+     clients from having to download the same content repeatedly
+     if a resource has not changed since the last time it was requested.
+     When nginx is used as a server for static files, it implements
+     the caching mechanism based on the
+     <link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified"><literal>Last-Modified</literal></link>
+     response header automatically; unfortunately, it works by using
+     filesystem timestamps to determine the value of the
+     <literal>Last-Modified</literal> header. This doesn't give the
+     desired behavior when the file is in the Nix store, because all
+     file timestamps are set to 0 (for reasons related to build
+     reproducibility).
+   </para>
+
+   <para>
+     Fortunately, HTTP supports an alternative (and more effective)
+     caching mechanism: the
+    <link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag"><literal>ETag</literal></link>
+    response header. The value of the <literal>ETag</literal> header
+    specifies some identifier for the particular content that the
+    server is sending (e.g. a hash). When a client makes a second
+    request for the same resource, it sends that value back in an
+    <literal>If-None-Match</literal> header. If the ETag value is
+    unchanged, then the server does not need to resend the content.
+   </para>
+
+   <para>
+    As of NixOS 19.09, the nginx package in Nixpkgs is patched such
+    that when nginx serves a file out of <filename>/nix/store</filename>,
+    the hash in the store path is used as the <literal>ETag</literal>
+    header in the HTTP response, thus providing proper caching functionality.
+    This happens automatically; you do not need to do modify any
+    configuration to get this behavior.
+   </para>
+  </section>
+ </section>
 </chapter>