mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-05-17 13:20:25 -04:00
Implemented page caching and cache control headers
This commit is contained in:
parent
913c7935c0
commit
b8e67721b8
4 changed files with 165 additions and 17 deletions
|
@ -53,6 +53,7 @@ class NomadNetworkApp:
|
|||
|
||||
self.pagespath = self.configdir+"/storage/pages"
|
||||
self.filespath = self.configdir+"/storage/files"
|
||||
self.cachepath = self.configdir+"/storage/cache"
|
||||
|
||||
self.downloads_path = os.path.expanduser("~/Downloads")
|
||||
|
||||
|
@ -78,6 +79,9 @@ class NomadNetworkApp:
|
|||
if not os.path.isdir(self.filespath):
|
||||
os.makedirs(self.filespath)
|
||||
|
||||
if not os.path.isdir(self.cachepath):
|
||||
os.makedirs(self.cachepath)
|
||||
|
||||
if os.path.isfile(self.configpath):
|
||||
try:
|
||||
self.config = ConfigObj(self.configpath)
|
||||
|
@ -128,7 +132,7 @@ class NomadNetworkApp:
|
|||
|
||||
if not "node_last_announce" in self.peer_settings:
|
||||
self.peer_settings["node_last_announce"] = None
|
||||
|
||||
|
||||
except Exception as e:
|
||||
RNS.log("Could not load local peer settings from "+self.peersettingspath, RNS.LOG_ERROR)
|
||||
RNS.log("The contained exception was: %s" % (str(e)), RNS.LOG_ERROR)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue