Share this page

# web.dumpCache

Miscellaneous Functions

Saves the Vuser cache to a file.

## Syntax

    web.dumpCache( {object} );

## JavaScript Object

    {
       stepName:"<string>",
       fileName:"<string>",
       replace:"<string>"
    }

Property Name | Description
--- | ---
stepName | The label of the step in the Graphical Vuser script. Also used as the transaction name for automatic transactions.
fileName | The full pathname of the file to store the cache.
replace | Overwrite existing file: "yes" or "no".

## Return Values

Not applicable

## Parameterization

All string arguments (char type) can be parameterized using standard parameterization.

## General Information

web.dumpCache saves the browser cache. It is used together with web.loadCache to implement Vuser persistent caching. The script always runs with the same initial cache.

The purpose is to capture the browser cache once, while running the script manually. Then the same cache can be used repeatedly in tests. Using Vuser persistent caching improves CPU usage on the application and database servers.

After recording the script, add web.loadCache at the beginning and web.dumpCache at the end of either the action or vuser_end section, as appropriate to your test. Run the script once with the web.loadCache call commented out. Then uncomment the web.loadCache call and comment out the web.dumpCache call. The result is that on each run the cache you created is reloaded.

The filename path can be absolute (e.g., "filename=c:\\MyDir\\User1.cache") or relative to the current Virtual User directory (e.g., "filename=Iteration1.cache"). Note that cache files folder must be created before running the dump command

If you use relative filenames, the files are copied with the script when saving to a new location, or copying to an load generator host. This behavior is platform independent and independent of drive mappings and network locations.

Use absolute path names only if you do not want the cache file to be linked to the script. For example, if you wish to use a different cache on each host, use absolute paths to prevent the cache from the development machine overwriting the host cache each time you enhance the script.

The file extension is ".cache". It is added even if not specified. For example, if you enter "filename=Iteration2.txt", the cache file is "filename=Iteration2.txt.cache".

File names can be parameterized, so that different Virtual Users or different iterations use different files. For example, "filename=Iteration{param}.cache"

replace specifies whether to replace the file if it exists already ("replace=yes") or not ("replace=no"). The default is "replace=yes".

Note: If the script is not developed on the machine that will be running the tests, ensure that the cache files are accessible to the host at the path given in fileName.

## Example

    web.dumpCache({name:"paycheckcache",
            fileName:"c:\\temp\\{VuserName}paycheck",
            replace:"yes"});

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: