Closed joanniclaborde closed 10 years ago
Where can I find some compressed resources to test against?
EdgeCast will gzip a cached resource if you ask for it. Make sure to test more than once; the first request is not compressed (EdgeCast zips in background), but later requests are zipped.
I'm not seeing compressed resources come back from staging: headers
{ 'cache-control': 'max-age=153',
'content-type': 'application/json',
date: 'Tue, 11 Feb 2014 02:24:29 GMT',
expires: 'Tue, 11 Feb 2014 02:27:03 UTC',
server: 'Goliath',
vary: 'Project,Api-Key,Accept',
'content-length': '626',
connection: 'close' }
other headers
{ server: 'nginx',
date: 'Tue, 11 Feb 2014 02:24:29 GMT',
'content-type': 'text/html;charset=utf-8',
'content-length': '23',
connection: 'close',
'x-frame-options': 'sameorigin',
'x-xss-protection': '1; mode=block' }
If you're seeing server: 'Goliath'
this means you're not being served by EdgeCast, but by Hipster...
Also, how come you get server: 'nginx'
? Maybe not a resource on storyteller.io?
One resource isn't on storyteller, so that's probably where the nginx
response came from. Just so we're clear, this resource should eventually return a cached version from edgecast, right? http://staging.proxy.storyteller.io/soundcloud/users/fauntlero-von-patton/favorites.json
Yes, and gzipped if you asked for it in the request headers.
But it should be pretty quick, within like 10 seconds if you make repeated requests with the same url and headers.
@joanniclaborde if these changes make sense to you, let's go ahead and merge this.
I think ultimately we want to do something like response_stream = res.pipe( new zlib.Unzip() ).pipe( JSONStream.parse() )
but I'd like to get more familiar with decoding JSON while inside a stream first.
Changes look good, tests pass, local test works too, I'll merge this into master.
Branch: f6Cl9nWE-enable-resource-compression
https://trello.com/c/f6Cl9nWE/651-enable-hipster-response-compression