"If-None-Match=" header added automatically on the second identical request

380 views
Skip to first unread message

Luca Fazari

unread,
Apr 27, 2017, 10:16:20 AM4/27/17
to Gatling User Group
Hello,

I'm using Gatling 2.2.5 and I have a test scenario that looks like this:

.exec(Request)
.exec(session =>{ 
println("TheResult 1(" + session("Result").as[String]+")")
session})
.exec(Request)
.exec(session =>{ 
println("TheResult 2(" + session("Result").as[String]+")")
session})

So calling on purpose two sequential identical GET requests ".exec(Request)" with no header (Request is a ChainBuilder).

The first one always goes fine, but the second one always fails (I get 304), and I have noticed that Gatling automatically adds the "If-None-Match=" header to the second one.
Why is this happening? 
I don't want that the header is added to the second request, so How can I overcome this?

Thanks in advance,
BR,
Luca

Kurt Sultan

unread,
Jan 25, 2018, 3:38:53 AM1/25/18
to Gatling User Group
Hello Luca, 

Have you solved this issue, currently I am also experiencing this problem. I appreciate the help. 

Domingos Creado

unread,
Feb 2, 2018, 9:59:00 AM2/2/18
to Gatling User Group
Hi Kurt ,

that is caused by the client caching.
you can disable it on http config like below:

 val httpConf = http
        .baseURL("https://url")
       .disableCaching

I hope that helps
Reply all
Reply to author
Forward
0 new messages