Http Helper - `flushHttpCache`

The docs note:

One might want to flush the whole HTTP cache (for the virtual user) :

exec(flushHttpCache)

What exactly does this mean?

If I have something like:

val scen = scenario("My Requests")
  .repeat(10) {
    exec(request1).pause(1.second).exec(request2).exec(flushHttpCache)
  }

scen.inject(atOnceUsers(5))

Does that mean that each and every request will include an HTTP Header to prevent the server from replying with a cached response?


Thanks

Absolutely not.

exec(flushHttpCache)

adds a step in your scenario where the current virtual user flushes its cache (cookies, downloaded content, etc), just like you would in your browsers settings.

Just wondering why this is not done by default in Gatling, if is the normal browser behaviour?

What? In a browser, you have to manually go into your setting and click on some button to empty your cache.

Yep true, does that means that disabling it is going to create an unrealistic user case? Why someone would use it then?

What do you mean by “disabling”?
flushHttpCache is mostly used when implementing a closed workload model.