I have set up an extremely basic Web Forms site locally to find out why when I do a load test through jMeter to a .Net website that the OutputCache directive on the page is ignored.
I'm using this directive at the top of the page:
<%@ OutputCache Duration="3600" VaryByParam="none" %>
In order to check if the cache is working I have a simple log4net log in the Page Load:
protected void Page_Load(object sender, EventArgs e)
{
log.Debug("In Page_Load");
}
When browsing the site through the Web Browser the OutputCache is behaving as expected as I get a log in the file once:
DEBUG [2014-04-05 15:44:56,905] - In Page_Load
When I continue to refresh the browser to the same page as well as using other browsers, there are no more logs which is expected behaviour.
I have then restarted IIS and then executed a very simple jMeter test of 5 threads with a delay of 1000 milliseconds and I get 5 "In Page_Load" logs instead of the expected 1 as above.
If I restart IIS, open the site in a browser window and then execute the load test I get the single log from the first manual browser request and no more logs as it seems doing that first request through the browser populates the web servers cache and the jMeter load test runs as expected.
Does anyone have experience with jMeter and .Net OutputCache?