How to get JMeter to request gzipped content?

后端 未结 1 1561
半阙折子戏
半阙折子戏 2020-12-14 15:27

My website serves gzipped content. I verified with Firebug and YSlow. However, JMeter does not request the gzipped content. Therefore, it gets all uncompressed content. As

相关标签:
1条回答
  • 2020-12-14 15:44

    Add an HTTP Header Manager to the Thread Group in your Test Plan.

    Add the name-value pair:

    • Name: Accept-Encoding
    • Value: gzip,deflate,sdch

    This will ensure that all JMeter requests use HTTP compression.

    To verify:

    1. Add this Listener to the Thread Group: View the Results Tree
    2. Run your test plan
    3. View the Sampler result tab for one of the webpages.

    Do you see these name-value pairs?

    Content-Encoding: gzip
    Vary: Accept-Encoding
    Transfer-Encoding: chunked
    

    If yes, then you've successfully setup gzip requests in JMeter. Congrats.

    Another way to verify is in the Summary Report stats:

    You'll see that the Avg Bytes values are the uncompressed sizes. That's OK. For whatever reason, that's how JMeter works. Pay attention to the KB/sec column. That will show an improvement of 6-10x with gzip enabled.

    0 讨论(0)
提交回复
热议问题