# HG changeset patch # User Goffi # Date 1587329775 -7200 # Node ID 8f39d98416c5f9863fe972c3bdd1a11880857577 # Parent 921e9f2a97afe7edc9732f25517de08775279eb5 server: added a child for common cache diff -r 921e9f2a97af -r 8f39d98416c5 libervia/server/server.py --- 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: