Has

Use cache_has() to determine if a cached variable exists. It accepts the following parameters:

  • KEY: The target variable to determine if it exists.
  • OUTPUT: Output variable to assign the result to.

Example

cache_has(
    KEY build_assets
    OUTPUT exists
)

if(exists)
    # ...not shown...
endif ()

Expired Entries

Just like cache_get(), the cache_has() function respects the expiration status of a cached variable. If the queried variable has expired, then this function will assign false to the OUTPUT variable.