-
-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GZIP compression and response size reporting issues #137
Comments
HTML: {
"url":"http://elecena.pl/",
"method":"GET"
"bodySize":10734,
"Content-Encoding":"gzip"
}
JS: {
"url":"http://cdn.macbre.net/elecena/r517/package/bootstrap,elecena,ui,suggest,ads,home.js",
"method":"GET",
"bodySize":988
}
Image (the same domain): {
"url":"http://beta.elecena/r517/skins/elecena/img/header.jpg",
"method":"GET",
"bodySize":9745
}
Image (different domain): {
"url":"http://cdn.macbre.net/elecena/r517/skins/elecena/img/header.jpg",
"method":"GET",
"bodySize":1044 |
Use HTTP proxy for running phantomas? https://github.com/nodejitsu/node-http-proxy/tree/caronte |
I like the idea of using the http proxy to get the correct bodySize when the response gzipped. Does the response object in the proxy have that information? |
I don't think so. This would need to be a custom proxy that will add that kind of information. |
Hey @macbre, just wanted to check in with the progress on this issue? Can I offer you my help? |
No progress on this one, unfortunately. Using proxy in this case would be a great example of overengineering :) Given the fact that PhantomJS v2.0 is just around the corner. @gurdenbatra, do you have a different solution on how to fix this issue? |
@macbre Do you know if I can at least accurately measure the differential of bodySize? As in, not look at the accuracy of the value but just monitor the rate of change? I do not have a solution in mind as the problem in hand is not completely clear to me. I'd love to help if you could point me in the right direction. Thanks. |
@gurdenbatra, unfortunately, as my tests above show |
https://github.com/ariya/phantomjs/issues?milestone=12&state=open - PhantomJS v2.0 is 15 days behind the deadline. I'm considering a workaround in phantomas... Something like a "light" HTTP proxy that will add |
Will re-check when #313 is implemented |
Still valid (v1.3.0):
stddev for sizes should be zero |
I have solved this on my own project, and oh boy it was a doozie. I will most certainly upstream a patch to phantomas. |
Great 👍 BTW, it works correctly under SlimerJS (introduced in phantomas v1.4.0) |
That's a great news!! |
Unfortunately, not much can be done on phantomas side with this issue. A patch from @cvan is kind of hacky :) Let's keep our fingers crossed for PhantomJS v2.0 (due by September 22, 2014) and use SlimerJS to run phantomas in the meantime. |
In my testing, SlimerJS has the same issues |
Has anyone tested this issue on PhantomJS 2 (preview) ? |
@jcleveley, good point. Binaries from GitHub repository you;ve mentioned do not run on my debian box:
Meanwhile I'm compiling the latest master from phantomjs' repository on droplet instance. Stay tuned :) |
See #432 for the similar issue - content size reporting for gzipped content |
hey @macbre , did phantomjs 2 work for you? I haven't tested yet for sitespeed.io, but planning checking it out this weekend or early next week. |
@soulgalore, just tested phantomas with PhantomJS2 binaries compiled in Oct 2014 and there's no improvement. For http://code.jquery.com/jquery-2.1.1.js I'm getting the following data:
{"id":3,"url":"http://code.jquery.com/jquery-2.1.1.js","method":"GET","requestHeaders":{"Accept":"*/*","Referer":"http://localhost:8888/jquery-multiple.html","User-Agent":"phantomas/1.8.0 (PhantomJS/1.9.8; linux x64)"},"sendTime":"2014-12-06T11:04:01.175Z","bodySize":1695,"isBlocked":false,"protocol":"http","domain":"code.jquery.com","recvStartTime":"2014-12-06T11:04:01.494Z","timeToFirstByte":319,"recvEndTime":"2014-12-06T11:04:01.663Z","timeToLastByte":488,"receiveTime":169,"type":"js","headers":{"Date":"Sat, 06 Dec 2014 11:04:01 GMT","Content-Type":"application/x-javascript","Transfer-Encoding":"chunked","Connection":"keep-alive","Last-Modified":"Fri, 24 Oct 2014 00:16:07 GMT","Vary":"Accept-Encoding","ETag":"W/\"54499a47-3c637\"","Expires":"Thu, 31 Dec 2037 23:55:55 GMT","Cache-Control":"max-age=315360000, public","Server":"NetDNA-cache/2.2","X-Cache":"HIT","Content-Encoding":"gzip"},"contentType":"application/x-javascript","isJS":true,"gzip":true,"status":200,"statusText":"OK","contentLength":1695}
{"id":3,"url":"http://code.jquery.com/jquery-2.1.1.js","method":"GET","requestHeaders":{"User-Agent":"phantomas/1.8.0 (PhantomJS/1.9.8; linux x64)","Accept":"*/*","Referer":"http://localhost:8888/jquery-multiple.html"},"sendTime":"2014-12-06T11:05:40.010Z","bodySize":45018,"isBlocked":false,"protocol":"http","domain":"code.jquery.com","recvStartTime":"2014-12-06T11:05:40.241Z","timeToFirstByte":231,"recvEndTime":"2014-12-06T11:05:40.365Z","timeToLastByte":355,"receiveTime":124,"type":"js","headers":{"Date":"Sat, 06 Dec 2014 11:05:40 GMT","Content-Type":"application/x-javascript","Transfer-Encoding":"chunked","Connection":"keep-alive","Last-Modified":"Fri, 24 Oct 2014 00:16:07 GMT","Vary":"Accept-Encoding","ETag":"W/\"54499a47-3c637\"","Expires":"Thu, 31 Dec 2037 23:55:55 GMT","Cache-Control":"max-age=315360000, public","Server":"NetDNA-cache/2.2","X-Cache":"HIT","Content-Encoding":"gzip"},"contentType":"application/x-javascript","isJS":true,"gzip":true,"status":200,"statusText":"OK","contentLength":45018}
{"id":3,"url":"http://code.jquery.com/jquery-2.1.1.js","method":"GET","requestHeaders":{"Host":"code.jquery.com","User-Agent":"phantomas/1.8.0 (SlimerJS/0.9.2; linux x64)","Accept":"*/*","Accept-Language":"en-US,en;q=0.5","Accept-Encoding":"gzip, deflate","Referer":"http://localhost:8888/jquery-multiple.html"},"sendTime":"2014-12-06T11:15:24.026Z","bodySize":247351,"isBlocked":false,"protocol":"http","domain":"code.jquery.com","recvStartTime":"2014-12-06T11:15:24.201Z","timeToFirstByte":175,"recvEndTime":"2014-12-06T11:15:24.366Z","timeToLastByte":340,"receiveTime":165,"type":"js","headers":{"Date":"Sat, 06 Dec 2014 11:15:24 GMT","Content-Type":"application/x-javascript","Transfer-Encoding":"chunked","Connection":"keep-alive","Last-Modified":"Fri, 24 Oct 2014 00:16:07 GMT","Vary":"Accept-Encoding","Etag":"W/\"54499a47-3c637\"","Expires":"Thu, 31 Dec 2037 23:55:55 GMT","Cache-Control":"max-age=315360000, public","Server":"NetDNA-cache/2.2","X-Cache":"HIT","Content-Encoding":"gzip"},"contentType":"application/x-javascript","isJS":true,"gzip":true,"status":200,"statusText":"OK","contentLength":247351} Chrome reports gzipped content to weight ~88 kB and 242 kB uncompressed. Numbers above are not even near the real values ;) |
hmm ok, thanks for the bad news :) |
In PhantomJS v2.0, Something like:
|
@fancyoung, PhantomJS v1.x does not provide Content-Length for gzip encoded content. Is it more reliable in PhantomJS 2.0? |
@macbre
to disable gzip, and it works for me. |
See ariya/phantomjs#10156 patch to ensure Content-Length is correctly returned when it is present. Still have to disable gzip as Content-Length header appears to be lost by QT. |
No good news here: phantomas using PhantomJS/2.1.1:
curl:
PhantomJS stats are still not reliable. However, when using SlimerJS we do get correct stats:
|
See #614 |
bodySize
See ariya/phantomjs#10156 and ariya/phantomjs#10169
The text was updated successfully, but these errors were encountered: