HTTP Cache Manager in Apache JMeter


The HTTP cache manager tries to simulate the browsers cache feature. Each thread has its own cache.

The HTTP cache manager tries to simulate the browsers cache feature. Each thread has its own cache. When you add the http cache manager in your test script( config element -> HTTP cache manager) , the control panel opens up:
Apache JMeter HTTP Cache Manager

There are the following columns:

  • Name : it is not mandatory but can be used to mark the element.
  • Max number of elements in cache : it is by default 5000 items per virtual user thread but can be changed according to the requirement. A large number will consume large amount of memory. We can change this default value by changing 'maxSize' in the property file.
  • Use Cache Control/Expires header when processing GET requests : if this is selected then the cache-control/ expire is checked against the current time. If the request is a GET request, and the timestamp is in the future, then the sampler returns immediately, without requesting the URL from the remote server. This is intended to emulate browser behaviour. Note that if Cache-Control header is "no-cache", the response will be stored in cache as pre-expired, so will generate a conditional GET request.
  • Clear cache each iteration : if this option is checked then the cache will be cleared with every new iteration.