Mercurial > hg > orthanc-book
comparison 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 |
comparison
equal
deleted
inserted
replaced
64:a3df3c2b68cf | 65:731d6c12f599 |
---|---|
39 "ServeFolders" : { | 39 "ServeFolders" : { |
40 "/fosdem" : "/home/jodogne/WWW/fosdem" | 40 "/fosdem" : "/home/jodogne/WWW/fosdem" |
41 } | 41 } |
42 } | 42 } |
43 | 43 |
44 | |
45 Advanced usage | |
46 -------------- | |
47 | |
48 Starting with Orthanc 1.2.0, the Serve Folders plugin features some | |
49 more advanced configuration options, besides simply the list of | |
50 folders to be served: | |
51 | |
52 * The **MIME types** associated with the file extensions can be | |
53 configured through the ``Extensions`` option. By default, the most | |
54 common file extensions for Web applications such as ``.html``, | |
55 ``.js`` and ``.css`` are defined. | |
56 * The HTTP client can be asked to enable/disable its **caching | |
57 mechanism** with the ``AllowCache`` option. By default, this option | |
58 is set ``false`` (request no caching), as the most common use for | |
59 this plugin consists in supporting the development of Web | |
60 applications (with which caching would interfere). Note that this | |
61 option is only informative: The client might choose to ignore it. | |
62 * The plugin will automatically generate an `HTTP entity tag | |
63 <https://en.wikipedia.org/wiki/HTTP_ETag>`__ (**ETag**) for each | |
64 served resource, if the ``GenerateETag`` option is set to ``true`` | |
65 (the default). The ETag is computed as the MD5 of the resource and | |
66 acts as a fingerprint. | |
67 | |
68 If one of these advanced options is used, the list of served folders | |
69 must be moved to a ``Folders`` sub-option. Here is an example of such | |
70 an advanced configuration:: | |
71 | |
72 { | |
73 [...] | |
74 "Plugins" : [ | |
75 "." | |
76 ], | |
77 "ServeFolders" : { | |
78 "AllowCache" : false, | |
79 "GenerateETag" : true, | |
80 "Extensions" : { | |
81 ".mp4" : "video/mp4" | |
82 }, | |
83 "Folders" : { | |
84 "/fosdem" : "/home/jodogne/WWW" | |
85 } | |
86 } | |
87 } |