diff libervia/server/server.py @ 1242:8f39d98416c5

server: added a child for common cache
author Goffi <goffi@goffi.org>
date Sun, 19 Apr 2020 22:56:15 +0200
parents 14c0f666a93d
children 079e8eb6e327
line wrap: on
line diff
--- a/libervia/server/server.py	Fri Feb 14 15:21:24 2020 +0100
+++ b/libervia/server/server.py	Sun Apr 19 22:56:15 2020 +0200
@@ -23,6 +23,7 @@
 import urllib.request, urllib.error
 import time
 import copy
+from pathlib import Path
 from twisted.application import service
 from twisted.internet import reactor, defer, inotify
 from twisted.web import server
@@ -864,8 +865,11 @@
         # FIXME: get rid of dirname and "/" in C.XXX_DIR
         self.putChildAll(os.path.dirname(C.MEDIA_DIR).encode('utf-8'),
                          ProtectedFile(self.media_dir))
+
         self.cache_resource = web_resource.NoResource()
         self.putChildAll(C.CACHE_DIR.encode('utf-8'), self.cache_resource)
+        self.cache_resource.putChild(
+            b"common", ProtectedFile(str(self.cache_root_dir / Path("common"))))
 
         # redirections
         for root in self.roots: