title: Jmeter Clear cache after each http request
body: <p>I am trying to clear the cache after each http request accomplished in a thread group. I have already used the http_cache manager but not successful.</p>
  
  <p>Also tried to add a beanshell sampler with following code but didn't work </p>
  
  <pre><code>import org.apache.jmeter.protocol.http.control.CacheManager;
  
  CacheManager clearCache = ctx.getCurrentSampler().getProperty("HTTPSampler.cache_manager").getObjectValue();
  
  clearCache.clear();
  </code></pre>
  
  <p>And getting </p>
  
  <pre><code>ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval   Sourced file: inline evaluation of: ``import org.apache.jmeter.protocol.http.control.CacheManager;  CacheManager clear . . . ''
  </code></pre>
  
  <p>Also tried to use the pre/post-processor, but not working. Also added the variable for http header.</p>
  
  <p>Please refer the screenshot attached. 
  header-screenshot
  <a href="https://i.stack.imgur.com/Sklwo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sklwo.png" alt="enter image description here"></a>
  Thread Group 
  <a href="https://i.stack.imgur.com/U1Keg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U1Keg.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/jcSYL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jcSYL.png" alt="enter image description here"></a></p>