In some situations, when you are performing a test execution using IBM Rational Performance Tester, you find the following HTTP options which can be utilized prior to executing the test scripts.
1. Clear cookie cache when the test starts
2. Clear page cache when the test starts
3. Disable page cache emulation in this test
It so happens that when you are running the script and you check the 3rd option of HTTP Options tab ("Disable page cache emulation in this test") in RPT, the script is passing. But your project team might want to test the application using cache, which is by emulating the cache. So in such cases you disable the page cache emulation option and notice that some of the pages requests shows failed execution status.
So what could be probable causes in such situations ??
Note, that RPT supports automatically emulating page caching functionality as well. (Because that's what browsers do!).
Under a scripts' HTTP Options there is an option to Turn Off page cache emulation (and also clear cookie cache to emulate a new user visiting the site).
Remember that RPT will record what the browser does. So for example, if you record a script without clearing the recording browser cache, you will have recorded a script that emulates a user with a full browser cache. To emulate users coming to a new site for the first time, or a site where cookies may have expired between visits, or just for ensuring you have a known starting point for your virtual users, ensure you clear your recording browser cache before recording your scripts.
A quick test to understand the difference is to record a script of your application's homepage. Ensure you clear the browser's cache then go to your applications homepage and wait five seconds. Then, select F5 to refresh the page, close the browser. In the script, you will see the first page all the page elements response code is 200. In the second page the page elements will be 304
These HTTP option changes can impact the response times and amount of work the server performs. Usually, it is recommended that you clear the browser cache prior to starting recording so that in the recording the server has to deliver the whole page and you get a 200 and not a 304.
As to what you need the answer would generally be to simulate the realistic behavior of the users. On one hand you can disable cache emulation which would mean that in a loop the server delivers all the page content on every iteration. But if the workload is in a loop simulating a user re-visiting pages you may want cache emulation turned on meaning on subsequent visits to pages the user visited before the server returns 304 because that is what would happen to such a user with a real browser.
In certain circumstances, deselecting the "Disable page cache emulation in this test" option might also result in the response header as :HTTP/1.1 304 RPT Used Cache - No Request Sent
Sometimes, RPT recognizes the request that contains the substitution as part of the cached traffic. Therefore RPT picks up the data from the cache, instead of dynamically rebuilding the request. In such cases, force RPT to dynamically rebuild the request. ie; Disable cache emulation.