Mercurial > libervia-web
comparison 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 |
comparison
equal
deleted
inserted
replaced
1018:78af5457d3f8 | 1019:34240d08f682 |
---|---|
70 HTTP_METHOD_GET = u'GET' | 70 HTTP_METHOD_GET = u'GET' |
71 HTTP_METHOD_POST = u'POST' | 71 HTTP_METHOD_POST = u'POST' |
72 | 72 |
73 ## HTTP codes ## | 73 ## HTTP codes ## |
74 HTTP_SEE_OTHER = 303 | 74 HTTP_SEE_OTHER = 303 |
75 HTTP_NOT_MODIFIED = 304 | |
75 HTTP_BAD_REQUEST = 400 | 76 HTTP_BAD_REQUEST = 400 |
76 HTTP_UNAUTHORIZED = 401 | 77 HTTP_UNAUTHORIZED = 401 |
77 HTTP_NOT_FOUND = 404 | 78 HTTP_NOT_FOUND = 404 |
78 HTTP_INTERNAL_ERROR = 500 | 79 HTTP_INTERNAL_ERROR = 500 |
79 HTTP_SERVICE_UNAVAILABLE = 503 | 80 HTTP_SERVICE_UNAVAILABLE = 503 |
80 | 81 |
81 ## Cache ## | 82 ## Cache ## |
82 CACHE_PUBSUB = 0 | 83 CACHE_PUBSUB = 0 |
84 | |
85 ## Date/Time ## | |
86 HTTP_DAYS = ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun") | |
87 HTTP_MONTH = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec") |