I was just curious to wonder how, if possible, one might issue an HTTP purge request method with Gatling/Scala to clear cache on a cache/proxy server as part of load/performance test setup/teardown.
Something like this in Java but Scala/Gatling equivalent:
However, whatever code you write in your simulation body will be executed when the simulation is instanciated, so you can get the same effect as before hook.
You won’t be able to use Gatling DSL for this though.
I advise you write this directly in Scala, and use the HTTP client we ship: async-http-client: