diff Sphinx/source/plugins/serve-folders.rst @ 65:731d6c12f599

advanced options of ServeFolders
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 Nov 2016 15:22:48 +0100
parents a3df3c2b68cf
children d217af5e6cb3
line wrap: on
line diff
--- a/Sphinx/source/plugins/serve-folders.rst	Tue Nov 22 13:02:56 2016 +0100
+++ b/Sphinx/source/plugins/serve-folders.rst	Tue Nov 22 15:22:48 2016 +0100
@@ -41,3 +41,47 @@
     }
   }
 
+
+Advanced usage
+--------------
+
+Starting with Orthanc 1.2.0, the Serve Folders plugin features some
+more advanced configuration options, besides simply the list of
+folders to be served:
+
+* The **MIME types** associated with the file extensions can be
+  configured through the ``Extensions`` option. By default, the most
+  common file extensions for Web applications such as ``.html``,
+  ``.js`` and ``.css`` are defined.
+* The HTTP client can be asked to enable/disable its **caching
+  mechanism** with the ``AllowCache`` option. By default, this option
+  is set ``false`` (request no caching), as the most common use for
+  this plugin consists in supporting the development of Web
+  applications (with which caching would interfere). Note that this
+  option is only informative: The client might choose to ignore it.
+* The plugin will automatically generate an `HTTP entity tag
+  <https://en.wikipedia.org/wiki/HTTP_ETag>`__ (**ETag**) for each
+  served resource, if the ``GenerateETag`` option is set to ``true``
+  (the default). The ETag is computed as the MD5 of the resource and
+  acts as a fingerprint.
+
+If one of these advanced options is used, the list of served folders
+must be moved to a ``Folders`` sub-option. Here is an example of such
+an advanced configuration::
+
+  {
+    [...]
+    "Plugins" : [ 
+      "."
+    ],
+    "ServeFolders" : {
+      "AllowCache" : false,
+      "GenerateETag" : true,
+      "Extensions" : {
+        ".mp4" : "video/mp4"
+      },
+      "Folders" : {
+        "/fosdem" : "/home/jodogne/WWW"
+      }
+    }
+  }