Skip to content
  • ZipCode Api
  • Blog
  • About RedLine13
RedLine13
Primary Navigation Menu
Menu
  • Start Testing
  • Demo
  • Pricing
  • Docs
    • Knowledge Base
    • AWS IAM Setup Instructions
    • Running a RedLine13 Load Test with Advanced Options
    • Scalability
    • Writing Open Load Tests in Your Language
    • Jenkins Plugin Setup
    • AWS Approval for Large Tests
    • Pro Features
  • JMeter
  • Partners

JMeter HTTP Cache Manager

By: RedLine13

HTTP Cache Manager – Why I should use it and an example.

Screen Shot 2016-01-19 at 11.48.20 PM

JMeter is not a browser, but JMeter provides config elements which helped to mimic the browser behavior and make your tests more realistic. “Cache manager” is used to simulate the browser caching behavior in Jmeter by adding caching functionality to HTTP requests within its scope.

In general, a browser caches files locally including any documents that make up a website, such as HTML files, CSS style sheets, JavaScript scripts, as well as graphic images and other multimedia content. When you revisit a website, the browser checks which content was updated in the meantime and only downloads updated files or what is not available in the cache. Bandwidth usage is reduced on both the user and server side and allows the page to load faster.

During load testing, we do not consider static resource files (like HTML, CSS, js, images, etc.) and JMeter does not download these static resources until it is explicitly configured to do so. HTTP Cache Manager must be included in your test plan if you have enabled your HTTP sampler to “Retrieve All Embedded Resources”.

retrieve-resources

HTTP Cache Manager will cache these downloaded resources and will not download again from the server until these are modified.

Cache manager properties

Screen Shot 2016-01-19 at 11.06.28 PM

  • Clear cache each iteration.  As it says, each iteration the cached content is wiped.
  • Use Cache-Control/Expires header when processing GET requests: If selected then Cache-Control/Expires value 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.
  • Max Number of elements in cache: By default value is set to 5000 which means cache manager will store 5000 items in the cache. You can increase this value but keep in mind that this will consume memory accordingly, and JMeter may throw “out of memory” exception. You may need to adjust your – Xmx value accordingly in JMeter .bat/.sh file or parameters in the RedLine13 load test.

For JMeter documentation, please refer to

http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Cache_Manager

Example Test Plan

Showing performance difference with and without HTTPCacheManager

  • https://www.redline13.com/share/testplan/23178

Test plan includes two thread groups (one include cache manager and other does not). Each thread group is hitting the same URL, but you will see the difference in average response times and data transferred KB/Sec. Also, if you look into the View results tree listener, then you will notice “Response code: 304 and Response message: Not Modified” in Sampler results tab for resources which were using cache manager.

Screen Shot 2016-01-19 at 11.41.14 PM

Screen Shot 2016-01-19 at 11.39.35 PM

 

2016-01-19
Previous Post: What are my options for using Assertions in JMeter
Next Post: Cloud Based JMeter WebSocket Testing

Recent Posts

  • Use Cases for the JMeter Dashboard Report
  • AWS Costs for Large JMeter Load Tests Run by Real Customers
  • AWS Multiple Account Setup for Load Testing – Securing your Application Environment
  • Merge Results for Data Analysis
  • Debug your JMeter Test with Output Files

Related

  • SAML SSO
  • E-Learning Companies and Load Testing
  • AWS Multiple Account Setup for Load Testing – Securing your Application Environment
  • AWS Costs for Large JMeter Load Tests Run by Real Customers
  • Why BlazeMeter Customers Chose RedLine13
  • Is BlazeMeter Scared Of RedLine13?
  • RedLine13 Customer HBO Latin America Speaks at Customer Advisory Board Meeting
  • ThinkLogic and High Volume Tests on RedLine13
  • Why ACT Moved from BlazeMeter – Highlights from the RedLine13 Customer Advisory Board Meeting
  • University of California Wanted a LoadRunner Alternative

© RedLine13, LLC | Privacy Policy | Contract
Contact Us: info@redline13.com