diff src/server/constants.py @ 1019:34240d08f682

pages: HTTP cache headers handling: when checkCache is used, HTTP headers handling cache are now used: - ETag is first checked, using a hash of the rendered content - Last-Modified is used as a fallback is client is not handling ETag When suitable, a HTTP 304 code (Not Modified) wihtout body is returned instead of the whole page.
author Goffi <goffi@goffi.org>
date Sun, 21 Jan 2018 13:14:06 +0100
parents b6dc6cf76473
children f2170536ba23
line wrap: on
line diff
--- a/src/server/constants.py	Sun Jan 21 13:08:54 2018 +0100
+++ b/src/server/constants.py	Sun Jan 21 13:14:06 2018 +0100
@@ -72,6 +72,7 @@
 
     ## HTTP codes ##
     HTTP_SEE_OTHER = 303
+    HTTP_NOT_MODIFIED = 304
     HTTP_BAD_REQUEST = 400
     HTTP_UNAUTHORIZED = 401
     HTTP_NOT_FOUND = 404
@@ -80,3 +81,7 @@
 
     ## Cache ##
     CACHE_PUBSUB = 0
+
+    ## Date/Time ##
+    HTTP_DAYS = ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")
+    HTTP_MONTH = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")