Http Helper - `flushHttpCache`

300 views
Skip to first unread message

Kevin Meredith

unread,
Apr 26, 2016, 11:29:15 PM4/26/16
to Gatling User Group
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

Stéphane LANDELLE

unread,
Apr 29, 2016, 3:38:30 AM4/29/16
to gat...@googlegroups.com
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. 

Stéphane Landelle
GatlingCorp CEO


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lorenzo Urbini

unread,
Apr 29, 2016, 5:16:48 PM4/29/16
to Gatling User Group
Just wondering why this is not done by default in Gatling, if is the normal browser behaviour?

Stéphane LANDELLE

unread,
Apr 29, 2016, 5:57:08 PM4/29/16
to gat...@googlegroups.com
What? In a browser, you have to manually go into your setting and click on some button to empty your cache.

Stéphane Landelle
GatlingCorp CEO


On Fri, Apr 29, 2016 at 11:16 PM, Lorenzo Urbini <super...@gmail.com> wrote:
Just wondering why this is not done by default in Gatling, if is the normal browser behaviour?

Lorenzo Urbini

unread,
Apr 29, 2016, 11:06:05 PM4/29/16
to Gatling User Group
Yep true, does that means that disabling it is going to create an unrealistic user case? Why someone would use it then?

Stéphane LANDELLE

unread,
Apr 30, 2016, 4:06:28 AM4/30/16
to gat...@googlegroups.com
What do you mean by "disabling"?
flushHttpCache is mostly used when implementing a closed workload model.

Stéphane Landelle
GatlingCorp CEO


On Sat, Apr 30, 2016 at 5:06 AM, Lorenzo Urbini <super...@gmail.com> wrote:
Yep true, does that means that disabling it is going to create an unrealistic user case? Why someone would use it then?
Reply all
Reply to author
Forward
0 new messages