1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

changes for auto scalar prototype:

- add cache headers for proxy
- wsgiprox 1.5.0
- decompresss brotli for now
This commit is contained in:
Ilya 2018-06-10 17:47:55 +00:00
parent 6572705ba8
commit 5aefa3ad4d
4 changed files with 14 additions and 2 deletions

View File

@ -205,6 +205,12 @@ class BaseContentRewriter(object):
if rwinfo.is_chunked:
stream = ChunkedDataReader(rwinfo.record.raw_stream,
decomp_type=None)
elif rw_http_headers.get_header('Content-Encoding') == 'br':
rw_http_headers.remove_header('Content-Encoding')
rw_http_headers.remove_header('Content-Length')
print('DECOMP')
stream = rwinfo.content_stream
else:
stream = rwinfo.record.raw_stream

View File

@ -94,6 +94,9 @@ class DefaultHeaderRewriter(object):
else:
new_headers_list.append(new_header)
if not self.rwinfo.is_url_rw():
self._add_cache_headers(new_headers_list, 100000)
return StatusAndHeaders(self.http_headers.statusline,
headers=new_headers_list,
protocol=self.http_headers.protocol)
@ -159,7 +162,7 @@ class DefaultHeaderRewriter(object):
else:
dt = datetime.utcnow()
dt = dt + timedelta(seconds=age)
new_headers.append(('Cache-Control', 'max-age=' + str(age)))
new_headers.append(('Cache-Control', 'public; max-age=' + str(age)))
new_headers.append(('Expires', datetime_to_http_date(dt)))

View File

@ -376,6 +376,9 @@ rules:
- action_load_comments
- filter
- url_prefix: 'com,youtube)/embed/'
fuzzy_lookup: '()'
- url_prefix: 'com,googlevideo,'

View File

@ -12,4 +12,4 @@ webencodings
gevent==1.2.2
webassets==0.12.1
portalocker
wsgiprox>=1.4.1
wsgiprox>=1.5.0