From 447125fbdc71977b8305295a76f47950eeb51658 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 25 May 2020 17:26:43 +0100 Subject: [PATCH] Without etag --- daemon.py | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/daemon.py b/daemon.py index 23fb3661b..99f13392f 100644 --- a/daemon.py +++ b/daemon.py @@ -1115,29 +1115,29 @@ class PubServer(BaseHTTPRequestHandler): fontType = 'application/font-woff2' fontFilename = \ self.server.baseDir + '/fonts/' + fontStr - if self._etag_exists(fontFilename): + #if self._etag_exists(fontFilename): # The file has not changed - self._304() + # self._304() + # return + #if self.server.fontsCache.get(fontStr): + # fontBinary = self.server.fontsCache[fontStr] + # self._set_headers_etag(fontFilename, + # fontType, + # fontBinary, cookie, + # callingDomain) + # self._write(fontBinary) + # return + #else: + if os.path.isfile(fontFilename): + with open(fontFilename, 'rb') as avFile: + fontBinary = avFile.read() + self._set_headers_etag(fontFilename, + fontType, + fontBinary, cookie, + callingDomain) + self._write(fontBinary) + self.server.fontsCache[fontStr] = fontBinary return - if self.server.fontsCache.get(fontStr): - fontBinary = self.server.fontsCache[fontStr] - self._set_headers_etag(fontFilename, - fontType, - fontBinary, cookie, - callingDomain) - self._write(fontBinary) - return - else: - if os.path.isfile(fontFilename): - with open(fontFilename, 'rb') as avFile: - fontBinary = avFile.read() - self._set_headers_etag(fontFilename, - fontType, - fontBinary, cookie, - callingDomain) - self._write(fontBinary) - self.server.fontsCache[fontStr] = fontBinary - return self._404() return