We've been testing with synthentic load testing and realized that our Web server was hit with much heavier load than real traffic. It turns out that tests do not respect the caching directives returned from the HTTP response. I reproduced this even using the recorder tool. I can see between steps 1 and 2, the same JS file is downloaded again (second time returned 200 instead of 304), despite having Cache-Control in the response.
Secondly, I learned that between tests, cache is cleared even for same Virtual User - is this correct? Any way to get around this? The problem is we have very short parameterized tests that ideally should be looped to simulate the user browsing across different pages, for example. But if the cache is cleared every run, that is no longer an accurate simulation and puts more load on the web server to serve up the resources every time.
Thanks for any advice!
Answer by David J. ·
Roy, After the initial object load the browser agent should follow the Cache-Control. Is the object on step 2 being requested from the same domain?
Running load tests that replicated returning visitors (with cached content) would require some modification of the scripts being used. You typically have two options, the first being to turn off any object requests for JS, CSS or Image content. This is done when you configure the load test. The second option would be to filter the objects which would be considered as being cached within the script.
Wait actions don't accept variables? 1 Answer
Detailed explanation of all GSL options 3 Answers
Testing Transaction 1 Answer