Book Image

JMeter Cookbook

By : Bayo Erinle
Book Image

JMeter Cookbook

By: Bayo Erinle

Overview of this book

Table of Contents (16 chapters)
JMeter Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using the HTTP Cache Manager component


In practice, web browsers have a caching mechanism to reduce the amount of data transferred over the network. This in turn gives end users a better experience. If data has not changed since the first time it was fetched from the remote server, there is no point fetching it again and thus, it can be fetched from a locally cached copy of the browser.

This same behavior can also be achieved with JMeter using the HTTP Cache Manager component. With the HTTP Cache Manager configured, JMeter is able to cache responses from sampled requests and serve them back on subsequent requests if they have not changed on the remote server.

How to do it…

In this recipe, we will add an HTTP Cache Manager component to a test plan and observe the response times in comparison to it being disabled. Perform the following steps:

  1. Launch JMeter.

  2. Open the pre-recorded script ch8_cache_manager.jmx bundled with the book. Alternatively, you can download it from http://git.io/cache_manager...