Cache and its impact on performance testing

What is Cache?

Cache is a temporary storage area where an applications non html resources are downloaded and stored when the user access the application for the first time. When the user again access the application, the request will not be sent to the server instead all the resources will be downloaded from the cache memory, making the user feel a faster page loading experience.

How does Cache impact performance testing?

Caching has a negative impact on the performance testing. When caching is enabled during the performance test the request will not be sent to the server and the resources will be downloaded from the cache memory thus showing an improved response time, providing improper test results. So cache has to be disabled during the performance tests.

Different Cache settings in loadrunner: (Run-time Settings --> Browser Emulation--> Browser Cache)

Simulate browser cache  - This option instructs the loadrunner to download the resources from the cache and it will not ask the server for the resources.

Simulate a new user on each iteration - This option instructs loadrunner to simulate a new user on each iteration and so a new cache. When this option is not selected same cache will be used for all the iterations.

With Simulate browser cache and Simulate a new user on each iteration - Loadrunner will use the same resources in the cache for each iteration but will load them only once per iteration.

With Simulate browser cache and without Simulate a new user on each iteration - Loadrunner will download the resources and save them in the cache during the first iteration and the same cache will be used from the second iteration.

web_cache_cleanup

  • web_cache_cleanup loadrunner function can be used in the script to clear the cache which is similar to the Simulate a new user on each iteration.
  • When web_cache_cleanup is used in the script, it will override all the cache Run-time settings.

1 comment:

  1. And if we want to cache images /css / policies ?
    How do you do please ?

    ReplyDelete