Share this page

# web_cache_cleanup

Clears the contents of the cache simulator.

## C Language

    int web_cache_cleanup();

Miscellaneous Functions

## Java Language

    int object.cache_cleanup( );

Miscellaneous Functions | Java Syntax

Argument | Description
--- | ---
object | An expression evaluating to an object of type WebApi. Usually web for Java. See also Function and Constant Prefixes.

## Return Values

This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure.

## Parameterization

Parameterization is not applicable to this function.

## General Information

The web_cache_cleanup function is a service function that clears the contents of the cache simulator. If the runtime setting option Simulate a new user each iteration is enabled on the Browser Emulation tab, then this function is automatically called at the beginning of each iteration.

This function is supported for all web scripts.

## C Example

In the following example, the web_cache_cleanup function clears the cache after reloading a page and its resources.

Copy code

    web_url("index.html",
        "URL=http://my_web_server/index.html",
         "Resource=0",
         "Referer=",
         "Mode=HTTP",
         LAST );web_url("survey.gif",
         "URL=http://my_web_server/gifs/survey.gif",
         "Resource=1",
         "Referer=http://my_web_server/index.html",
         LAST );web_url("top_blue.gif",
         "URL=http://my_web_server/gifs/top_blue.gif",
         "Resource=1",
         "Referer=http://my_web_server/index.html",
         LAST );. . . // Reload home pageweb_url("index.html",
         "URL=http://my_web_server/index.html",
         "Resource=0",
         "Referer=",
         "Mode=HTTP",
         LAST );web_url("top_blue.gif",
         "URL=http://my_web_server/gifs/top_blue.gif",
         "Resource=1",
         "Referer=http://my_web_server/index.html",
         LAST );web_cache_cleanup();

## Java Example

Copy code

    web.url("index.html",
        "URL=http://my_web_server/index.html",
        new String[]{
             "Resource=0",
             "Referer=",
             "Mode=HTTP",
             "LAST"
         });
    web.url("survey.gif",
         "URL=http://my_web_server/gifs/survey.gif",
         new String[]{
             "Resource=1",
             "Referer=http://my_web_server/index.html",
             "LAST"
         });
    web.url("top_blue.gif",
         "URL=http://my_web_server/gifs/top_blue.gif",
         new String[]{
             "Resource=1",
             "Referer=http://my_web_server/index.html",
             "LAST"
         });
    // Reload home page
    web.url("index.html",
         "URL=http://my_web_server/index.html",
         new String[]{
             "Resource=0",
             "Referer=",
             "Mode=HTTP",
             "LAST"
         });
    web.url("top_blue.gif",
         "URL=http://my_web_server/gifs/top_blue.gif",
         new String[]{
             "Resource=1",
             "Referer=http://my_web_server/index.html",
             "LAST"
         });
    // Clear the cache after reloading a page and its resources.
    web.cache_cleanup();

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: