Skip to content

Instantly share code, notes, and snippets.

@JonnoFTW
Created June 23, 2018 09:08
Show Gist options
  • Save JonnoFTW/11cc2d7eabbc269b24e27cddb1761924 to your computer and use it in GitHub Desktop.
Save JonnoFTW/11cc2d7eabbc269b24e27cddb1761924 to your computer and use it in GitHub Desktop.
Pyramid 304 bug
from pyramid.config import Configurator
def main(global_config, **settings):
config = Configurator(settings=settings)
config.add_static_view('static', 'static', cache_max_age=3600)
return config.make_wsgi_app()
# start server with: pserve development.ini
$ telnet.exe localhost 6543
Trying ::1...
Connected to localhost.
Escape character is '^]'.
GET /static/test.css HTTP/1.1
Host: p:6543
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-AU,en-GB;q=0.7,en;q=0.3
DNT: 1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
If-Modified-Since: Mon, 23 Jun 2018 10:28:41 GMT
Cache-Control: max-age=0
HTTP/1.1 200 OK
Cache-Control: max-age=3600
Content-Length: 32
Content-Type: text/css; charset=UTF-8
Date: Sat, 23 Jun 2018 09:00:18 GMT
Expires: Sat, 23 Jun 2018 10:00:18 GMT
Last-Modified: Sat, 23 Jun 2018 08:54:31 GMT
Server: waitress
html, body {
height: 100%;
}
GET /static/test.css HTTP/1.1
Host: p:6543
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-AU,en-GB;q=0.7,en;q=0.3
DNT: 1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
If-Modified-Since: Mon, 23 Jun 2018 10:28:41 GMT
Cache-Control: max-age=0
HTTP/1.1 304 Not Modified
Cache-Control: max-age=3600
Connection: close
Date: Sat, 23 Jun 2018 09:00:52 GMT
Expires: Sat, 23 Jun 2018 10:00:52 GMT
Last-Modified: Sat, 23 Jun 2018 08:54:31 GMT
Server: waitress
Transfer-Encoding: chunked
0
Connection closed by foreign host.
html, body {
height: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment