---
product: Chilkat
product_version: 11.7.0
language: sqlserver
language_label: SQL Server
class: Cache
license: bundle
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/sqlserver_CacheRef.html
---
# Chilkat Cache — SQL Server — v11.7.0

> Chilkat 11.7.0 · language=sqlserver · class=Cache
> Other versions: replace `11.7.0` in this URL. Other languages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/<lang>/classes/Cache.md`.
> Language-wide rules (install, unlock, error model, strings/bytes): `https://www.chilkatsoft.com/ai-docs/v/11.7.0/sqlserver/guide.md`.

## Purpose

**Store, retrieve, expire, and clean up cached text or binary data on disk.**

`Chilkat.Cache` is a disk-based cache class for storing and retrieving text or binary items by unique key. It provides configurable cache roots, optional multi-level directory layout, expiration metadata, ETag metadata, cache lookup, fetch-status properties, expiration updates, and cleanup methods for deleting individual items, expired items, older items, or the entire cache.

**Key-based storage**

Store and retrieve cached items by unique key, without the application needing to manage the underlying cache filenames directly.

**Text and binary data**

Cache strings, byte data, files, or Chilkat buffer objects depending on the data form used by the application.

**Expiration control**

Associate cached items with expiration times, update expiration metadata, and check whether cached content is still usable.

**ETag metadata**

Store and retrieve ETag values for workflows that need HTTP-style cache validation or conditional re-fetch logic.

**Configurable layout**

Choose the cache root directory and use an optional multi-level directory structure to avoid too many files in a single folder.

**Cleanup operations**

Delete a single cached item, remove expired items, remove older items, or clear the entire cache when needed.

**Common pattern:** Configure the cache root, choose the key used to identify each item, check whether a valid cached copy exists, fetch or regenerate the content when needed, store it with expiration and optional ETag metadata, and periodically clean up expired or old cached items.

For an extended overview, see [Cache Class Overview](https://www.chilkatsoft.com/cache_class_overview.asp).

## Object creation, unlocking and error handling

**Object Creation**

```sql
DECLARE @hr int
DECLARE @cache int
EXEC @hr = sp_OACreate 'Chilkat.Cache', @cache OUT
IF @hr <> 0
BEGIN
    PRINT 'Failed to create ActiveX component'
    RETURN
END

-- ... use @cache ...

EXEC @hr = sp_OADestroy @cache
```

T-SQL uses the Chilkat ActiveX through the OLE Automation stored procedures. They must be enabled once on the server (`EXEC sp_configure 'Ole Automation Procedures', 1; RECONFIGURE;`), and the Chilkat ActiveX registered must match the bitness of the SQL Server instance (64-bit for a 64-bit SQL Server). To bind to a specific major version of Chilkat, append the major version number to the ProgID, such as `sp_OACreate 'Chilkat.Cache.11'` for Chilkat v11.\*.\*.

`sp_OACreate` returns an object token (an `int`) that is passed as the first argument of every `sp_OAMethod`, `sp_OAGetProperty` and `sp_OASetProperty` call, and released with `sp_OADestroy`. Objects returned by methods (such as an `HttpResponse` or `JsonObject`) are also tokens received through an `int` OUT parameter; they must likewise be destroyed, and the OUT parameter is `NULL` when the method fails to return an object. Objects passed as arguments are passed by their token. When an OLE Automation procedure itself fails (non-zero `@hr`), `sp_OAGetErrorInfo` describes the error.

Data types: strings are `nvarchar(4000)`; integers, booleans (1 or 0) and object tokens are `int`; dates are `datetime`. In the signatures on this page, `@success`, `@iResult`, `@sResult` and the like are the OUT variables receiving a method's return value, `@iValue` / `@sValue` receive or supply a property value, and the remaining `@` variables are the method's arguments in order.

A string returned through an OUT parameter is limited to 4000 characters. For longer values, retrieve the result as a result set into a table variable instead of an OUT parameter, for example `DECLARE @tmp TABLE (outputLine ntext)` followed by `INSERT INTO @tmp EXEC sp_OAGetProperty @cache, 'LastErrorText'`. See [string length limitations for strings returned by sp_OAMethod calls](https://www.chilkatsoft.com/sql_server_nvarchar_max_limitation.asp).

Methods that pass or return raw byte arrays are not shown on this page, because `varbinary(max)` values cannot be exchanged through `sp_OAMethod` (see [varbinary(max) limitation](https://www.chilkatsoft.com/sql_server_varbinary_max_limitation.asp)). Use the `BinData`-based alternatives (methods ending in *Bd*) or the base64 / hex string-encoded variants instead. Binary *properties* (such as `LastBinaryResult`) can be retrieved as a result set into a table variable, as shown in their signatures. Asynchronous (*\*Async*) methods and event callbacks are not available from SQL Server.

Call `Global.UnlockBundle` once at the start of the program, before using this or any other Chilkat class. Any string unlocks a fully functional 30-day trial; a purchased unlock code is used in production. See `guide.md` for the exact code in SQL Server.

How failure is reported depends on the method's return type and is stated in the note under each method below. In every case the diagnostic text is in the `LastErrorText` property of the object whose method was called.

## Members common to every Chilkat class

Documented once per language in `common-members.md`; listed here so this page is self-contained.

| Property | Signature | Access | Meaning |
|---|---|---|---|
| `DebugLogFilePath` | `EXEC sp_OAGetProperty @cache, 'DebugLogFilePath', @sValue OUT EXEC sp_OASetProperty @cache, 'DebugLogFilePath', @sValue` | read/write | If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. |
| `LastBinaryResult` | `INSERT INTO @tmp EXEC sp_OAGetProperty @cache, 'LastBinaryResult'` | read-only | This property is mainly used in SQL Server stored procedures to retrieve binary data from the last method call that returned binary data. |
| `LastErrorHtml` | `EXEC sp_OAGetProperty @cache, 'LastErrorHtml', @sValue OUT` | read-only | Provides HTML-formatted information about the last called method or property. |
| `LastErrorText` | `EXEC sp_OAGetProperty @cache, 'LastErrorText', @sValue OUT` | read-only | Provides plain text information about the last called method or property. |
| `LastErrorXml` | `EXEC sp_OAGetProperty @cache, 'LastErrorXml', @sValue OUT` | read-only | Provides XML-formatted information about the last called method or property. |
| `LastMethodSuccess` | `EXEC sp_OAGetProperty @cache, 'LastMethodSuccess', @iValue OUT EXEC sp_OASetProperty @cache, 'LastMethodSuccess', @iValue` | read/write | Indicates the success or failure of the most recent method call: `1` means success, `0` means failure. |
| `LastStringResult` | `EXEC sp_OAGetProperty @cache, 'LastStringResult', @sValue OUT` | read-only | In SQL Server stored procedures, this property holds the string return value of the most recent method call that returns a string. |
| `LastStringResultLen` | `EXEC sp_OAGetProperty @cache, 'LastStringResultLen', @iValue OUT` | read-only | The length, in characters, of the string contained in the LastStringResult property. |
| `VerboseLogging` | `EXEC sp_OAGetProperty @cache, 'VerboseLogging', @iValue OUT EXEC sp_OASetProperty @cache, 'VerboseLogging', @iValue` | read/write | If set to `1`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. |
| `Version` | `EXEC sp_OAGetProperty @cache, 'Version', @sValue OUT` | read-only | Version of the component/library, such as "10.1.0" |

## Member index

| Member | Kind | Signature |
|---|---|---|
| `LastEtagFetched` | property, read-only | `EXEC sp_OAGetProperty @cache, 'LastEtagFetched', @sValue OUT` |
| `LastExpirationFetchedStr` | property, read-only | `EXEC sp_OAGetProperty @cache, 'LastExpirationFetchedStr', @sValue OUT` |
| `LastHitExpired` | property, read-only | `EXEC sp_OAGetProperty @cache, 'LastHitExpired', @iValue OUT` |
| `LastKeyFetched` | property, read-only | `EXEC sp_OAGetProperty @cache, 'LastKeyFetched', @sValue OUT` |
| `Level` | property, read/write | `EXEC sp_OAGetProperty @cache, 'Level', @iValue OUT EXEC sp_OASetProperty @cache, 'Level', @iValue` |
| `NumRoots` | property, read-only | `EXEC sp_OAGetProperty @cache, 'NumRoots', @iValue OUT` |
| `AddRoot` | method | `EXEC sp_OAMethod @cache, 'AddRoot', NULL, @path` |
| `DeleteAll` | method | `EXEC sp_OAMethod @cache, 'DeleteAll', @iResult OUT` |
| `DeleteAllExpired` | method | `EXEC sp_OAMethod @cache, 'DeleteAllExpired', @iResult OUT` |
| `DeleteFromCache` | method | `EXEC sp_OAMethod @cache, 'DeleteFromCache', @success OUT, @key` |
| `DeleteOlderDt` | method | `EXEC sp_OAMethod @cache, 'DeleteOlderDt', @iResult OUT, @dt` |
| `DeleteOlderStr` | method | `EXEC sp_OAMethod @cache, 'DeleteOlderStr', @iResult OUT, @dateTimeStr` |
| `FetchBd` | method | `EXEC sp_OAMethod @cache, 'FetchBd', @success OUT, @key, @bd` |
| `FetchSb` | method | `EXEC sp_OAMethod @cache, 'FetchSb', @success OUT, @key, @sb` |
| `FetchText` | method | `EXEC sp_OAMethod @cache, 'FetchText', @sResult OUT, @key` |
| `GetEtag` | method | `EXEC sp_OAMethod @cache, 'GetEtag', @sResult OUT, @key` |
| `GetExpirationStr` | method | `EXEC sp_OAMethod @cache, 'GetExpirationStr', @sResult OUT, @url` |
| `GetFilename` | method | `EXEC sp_OAMethod @cache, 'GetFilename', @sResult OUT, @key` |
| `GetRoot` | method | `EXEC sp_OAMethod @cache, 'GetRoot', @sResult OUT, @index` |
| `IsCached` | method | `EXEC sp_OAMethod @cache, 'IsCached', @success OUT, @key` |
| `SaveBd` | method | `EXEC sp_OAMethod @cache, 'SaveBd', @success OUT, @key, @expiration, @etag, @bd` |
| `SaveTextDt` | method | `EXEC sp_OAMethod @cache, 'SaveTextDt', @success OUT, @key, @expireDateTime, @eTag, @itemTextData` |
| `SaveTextNoExpire` | method | `EXEC sp_OAMethod @cache, 'SaveTextNoExpire', @success OUT, @key, @eTag, @itemTextData` |
| `SaveTextStr` | method | `EXEC sp_OAMethod @cache, 'SaveTextStr', @success OUT, @key, @expireDateTime, @eTag, @itemTextData` |
| `UpdateExpirationDt` | method | `EXEC sp_OAMethod @cache, 'UpdateExpirationDt', @success OUT, @key, @expireDateTime` |
| `UpdateExpirationStr` | method | `EXEC sp_OAMethod @cache, 'UpdateExpirationStr', @success OUT, @key, @expireDateTime` |

Deprecated members are listed at the end of this file with their replacements; do not use them in new code.

## Properties

### Cache.LastEtagFetched

`Chilkat 11.7.0 · sqlserver · Cache · LastEtagFetched · property · read-only`

```sql
EXEC sp_OAGetProperty @cache, 'LastEtagFetched', @sValue OUT
```

Returns the ETag metadata associated with the most recently fetched cache item. An empty string means that the fetched item has no stored ETag.

**Read after a fetch:** This property describes the item returned by the most recent successful fetch operation, such as `FetchBd`, `FetchSb`, or `FetchText`.

**ETags are opaque metadata:** The cache stores and returns the string but does not interpret it. Applications commonly use an HTTP ETag with conditional requests such as `If-None-Match`.

### Cache.LastExpirationFetchedStr

`Chilkat 11.7.0 · sqlserver · Cache · LastExpirationFetchedStr · property · read-only`

```sql
EXEC sp_OAGetProperty @cache, 'LastExpirationFetchedStr', @sValue OUT
```

Returns the expiration date and time stored for the most recently fetched cache item, formatted as an RFC 822-style Internet date. An empty string represents an item with no expiration date.

**Expiration is metadata:** Fetching an expired item is still possible. Read `LastHitExpired` after the fetch to determine whether the returned entry is stale.

### Cache.LastHitExpired

`Chilkat 11.7.0 · sqlserver · Cache · LastHitExpired · property · read-only`

```sql
EXEC sp_OAGetProperty @cache, 'LastHitExpired', @iValue OUT
```

Returns `1` when the expiration time of the most recently fetched item is earlier than the current system date and time; otherwise returns `0`.

**Expired does not mean deleted:** Expiration marks an entry as stale. The file remains in the cache until it is replaced or removed by methods such as `DeleteAllExpired` or `DeleteFromCache`.

### Cache.LastKeyFetched

`Chilkat 11.7.0 · sqlserver · Cache · LastKeyFetched · property · read-only`

```sql
EXEC sp_OAGetProperty @cache, 'LastKeyFetched', @sValue OUT
```

Returns the application-defined key associated with the most recently fetched cache item.

**Keys are not limited to URLs:** A canonicalized URL is a common key for cached web content, but any unique string may be used. Reusing a key causes a save operation to replace the existing item for that key.

### Cache.Level

`Chilkat 11.7.0 · sqlserver · Cache · Level · property · read/write`

```sql
EXEC sp_OAGetProperty @cache, 'Level', @iValue OUT
EXEC sp_OASetProperty @cache, 'Level', @iValue
```

Gets or sets the number of directory levels used beneath each cache root. Valid values are `0`, `1`, and `2`.

| Value | Directory layout |
| :--- | :--- |
| `0` | All cache files are stored directly in the cache root. |
| `1` | Files are distributed among 256 first-level directories named `0` through `255`. |
| `2` | Files are distributed through two levels of 256 directories, allowing as many as 65,536 leaf directories per root. |

**Configure before use:** Use the same level when reopening an existing cache. Changing the layout does not reorganize previously stored files and can prevent the object from locating them through their keys.

### Cache.NumRoots

`Chilkat 11.7.0 · sqlserver · Cache · NumRoots · property · read-only`

```sql
EXEC sp_OAGetProperty @cache, 'NumRoots', @iValue OUT
```

Returns the number of cache-root directories that have been registered by calling `AddRoot`.

**Multiple roots:** A cache may span more than one directory or storage device. Configure the same root set when reopening a persistent cache so previously stored items remain discoverable.

## Methods

### Cache.AddRoot

`Chilkat 11.7.0 · sqlserver · Cache · AddRoot · method`

```sql
EXEC sp_OAMethod @cache, 'AddRoot', NULL, @path
```

Adds `path` as a root directory for the disk cache. Call this method once for each root that should participate in the cache.

For example, a cache distributed across `D:\cacheRoot`, `E:\cacheRoot`, and `F:\cacheRoot` is configured by calling this method three times.

**Use dedicated writable directories:** Cache cleanup methods can delete cache files beneath every configured root. Do not mix unrelated application files into a cache root.

**Persistent configuration:** Recreate the same roots and `Level` setting before accessing a cache created by an earlier process or application run.

### Cache.DeleteAll

`Chilkat 11.7.0 · sqlserver · Cache · DeleteAll · method`

```sql
EXEC sp_OAMethod @cache, 'DeleteAll', @iResult OUT
```

Deletes every cache item from all configured roots and returns the number of cache files removed. Multi-level subdirectories are retained.

**Destructive operation:** This cannot be limited to a key prefix or reversed. Use cache roots dedicated to Chilkat cache data.

### Cache.DeleteAllExpired

`Chilkat 11.7.0 · sqlserver · Cache · DeleteAllExpired · method`

```sql
EXEC sp_OAMethod @cache, 'DeleteAllExpired', @iResult OUT
```

Deletes all cache items whose stored expiration time is earlier than the current system time and returns the number of files removed.

**Non-expiring entries remain:** Items saved without an expiration date are not removed by this method.

### Cache.DeleteFromCache

`Chilkat 11.7.0 · sqlserver · Cache · DeleteFromCache · method`

```sql
EXEC sp_OAMethod @cache, 'DeleteFromCache', @success OUT, @key
```

Deletes the cache item identified by `key`.

| Return value | Meaning |
| :--- | :--- |
| `1` | The item was deleted, or no item existed for the key. |
| `0` | The item exists but could not be deleted, for example because of a filesystem permission or sharing error. |

**Idempotent deletion:** A missing key is not treated as an error, which makes it safe to call this method when the application merely wants to ensure that an item is absent.

Returns 1 for success, 0 for failure.

### Cache.DeleteOlderDt

`Chilkat 11.7.0 · sqlserver · Cache · DeleteOlderDt · method`

```sql
EXEC sp_OAMethod @cache, 'DeleteOlderDt', @iResult OUT, @dt
```

Deletes cache items older than the cutoff date and time supplied in `dt`.

Returns the number of cache files deleted, or `-1` if an error occurs.

**Different from expiration cleanup:** Use `DeleteAllExpired` when the decision should be based specifically on each item's expiration metadata.

### Cache.DeleteOlderStr

`Chilkat 11.7.0 · sqlserver · Cache · DeleteOlderStr · method`

```sql
EXEC sp_OAMethod @cache, 'DeleteOlderStr', @iResult OUT, @dateTimeStr
```

Deletes cache items older than the cutoff date and time supplied in `dateTimeStr` as an RFC 822-style Internet date string.

Returns the number of cache files deleted, or `-1` if an error occurs.

**Date format:** A typical value is `Mon, 03 Aug 2026 12:00:00 GMT`. Use `DeleteOlderDt` when the cutoff is already available as a `CkDateTime`.

### Cache.FetchBd

`Chilkat 11.7.0 · sqlserver · Cache · FetchBd · method · since 9.5.0.91`

```sql
EXEC sp_OAMethod @cache, 'FetchBd', @success OUT, @key, @bd
```

Retrieves the binary item identified by `key` and loads its bytes into the `BinData` object supplied in `bd`.

The key is application-defined, may contain any characters, and must uniquely identify the intended item.

**Check the return value:** Use the destination only when this method returns `1`. A failed lookup or filesystem error returns `0`.

**Freshness:** A successful fetch may return an expired item. Read `LastHitExpired` immediately afterward when stale data must not be used.

Returns 1 for success, 0 for failure.

### Cache.FetchSb

`Chilkat 11.7.0 · sqlserver · Cache · FetchSb · method · since 9.5.0.91`

```sql
EXEC sp_OAMethod @cache, 'FetchSb', @success OUT, @key, @sb
```

Retrieves the text item identified by `key` and loads its content into the `StringBuilder` supplied in `sb`.

The key is application-defined, may contain any characters, and must uniquely identify the intended item.

**Check the return value:** Use the destination only when this method returns `1`. A failed lookup or filesystem error returns `0`.

**Freshness:** A successful fetch may return an expired item. Read `LastHitExpired` immediately afterward when stale data must not be used.

Returns 1 for success, 0 for failure.

### Cache.FetchText

`Chilkat 11.7.0 · sqlserver · Cache · FetchText · method`

```sql
EXEC sp_OAMethod @cache, 'FetchText', @sResult OUT, @key
```

Retrieves the text item identified by `key` and returns its string content.

The key is application-defined, may contain any characters, and must uniquely identify the intended item.

**Freshness is separate:** A successful fetch can return an expired entry. Read `LastHitExpired` immediately afterward when the application requires only fresh data.

Returns `NULL` on failure

### Cache.GetEtag

`Chilkat 11.7.0 · sqlserver · Cache · GetEtag · method`

```sql
EXEC sp_OAMethod @cache, 'GetEtag', @sResult OUT, @key
```

Returns the ETag metadata stored with the cache item identified by `key`.

**Opaque value:** Chilkat does not parse or validate the ETag. An application may store any auxiliary string here, although HTTP entity tags are the common use case.

Returns `NULL` on failure

### Cache.GetExpirationStr

`Chilkat 11.7.0 · sqlserver · Cache · GetExpirationStr · method`

```sql
EXEC sp_OAMethod @cache, 'GetExpirationStr', @sResult OUT, @url
```

Returns the expiration date and time stored for the item identified by `url`, formatted as an RFC 822-style Internet date string.

**Argument name:** Some language bindings name `url` `url` for historical reasons. It is the cache key and does not need to be a URL.

**No-expiration entries:** An empty stored expiration represents an item that does not expire automatically.

Returns `NULL` on failure

### Cache.GetFilename

`Chilkat 11.7.0 · sqlserver · Cache · GetFilename · method`

```sql
EXEC sp_OAMethod @cache, 'GetFilename', @sResult OUT, @key
```

Returns the absolute filesystem path of the cache file associated with `key`.

**Implementation detail:** Treat the returned path as diagnostic information. Applications should normally read, update, and delete entries through the `Cache` API rather than modifying cache files directly.

Returns `NULL` on failure

### Cache.GetRoot

`Chilkat 11.7.0 · sqlserver · Cache · GetRoot · method`

```sql
EXEC sp_OAMethod @cache, 'GetRoot', @sResult OUT, @index
```

Returns the directory path of the cache root at zero-based `index`. Valid indexes range from `0` through `NumRoots - 1`.

Returns `NULL` on failure

### Cache.IsCached

`Chilkat 11.7.0 · sqlserver · Cache · IsCached · method`

```sql
EXEC sp_OAMethod @cache, 'IsCached', @success OUT, @key
```

Returns `1` if an item exists for `key`, or `0` if the key is not present.

**Presence is not freshness:** This method does not imply that the entry is unexpired. Fetch the item and examine `LastHitExpired`, or read its expiration metadata, when freshness matters.

### Cache.SaveBd

`Chilkat 11.7.0 · sqlserver · Cache · SaveBd · method · since 11.0.0`

```sql
EXEC sp_OAMethod @cache, 'SaveBd', @success OUT, @key, @expiration, @etag, @bd
```

Stores the contents of `bd` as binary cache data under `key`. If the key already exists, its data and metadata are replaced.

| Argument | Purpose |
| :--- | :--- |
| `key` | The unique application-defined cache key. |
| `expiration` | Expiration as an RFC 822-style Internet date string. Pass an empty string for no expiration. |
| `etag` | Optional ETag or application metadata. Pass an empty string when unused. |
| `bd` | The `BinData` containing the bytes to save. |

**Expiration is not automatic deletion:** An expired item remains present until it is replaced or explicitly removed. This permits stale-while-revalidate workflows but requires the application to check freshness.

Returns 1 for success, 0 for failure.

### Cache.SaveTextDt

`Chilkat 11.7.0 · sqlserver · Cache · SaveTextDt · method`

```sql
EXEC sp_OAMethod @cache, 'SaveTextDt', @success OUT, @key, @expireDateTime, @eTag, @itemTextData
```

Stores `itemTextData` as a text cache item under `key`, with the expiration date and time supplied in `expireDateTime`. If the key already exists, its data and metadata are replaced.

`eTag` is optional ETag or application metadata and may be an empty string. The key may contain any characters and may be any length, but it must uniquely identify the item.

**Expiration does not delete:** After the expiration time passes, the entry remains on disk and can still be fetched. Use `LastHitExpired` to detect staleness and a deletion method to remove it.

Returns 1 for success, 0 for failure.

### Cache.SaveTextNoExpire

`Chilkat 11.7.0 · sqlserver · Cache · SaveTextNoExpire · method`

```sql
EXEC sp_OAMethod @cache, 'SaveTextNoExpire', @success OUT, @key, @eTag, @itemTextData
```

Stores `itemTextData` as a non-expiring text cache item under `key`. If the key already exists, its data and metadata are replaced.

`eTag` is optional ETag or application metadata and may be an empty string.

Returns 1 for success, 0 for failure.

### Cache.SaveTextStr

`Chilkat 11.7.0 · sqlserver · Cache · SaveTextStr · method`

```sql
EXEC sp_OAMethod @cache, 'SaveTextStr', @success OUT, @key, @expireDateTime, @eTag, @itemTextData
```

Stores `itemTextData` as a text cache item under `key`, with `expireDateTime` providing the expiration time as an RFC 822-style Internet date string. If the key already exists, its data and metadata are replaced.

`eTag` is optional ETag or application metadata and may be empty.

**Date alternatives:** Use `SaveTextDt` when the expiration is available as a `CkDateTime`, or `SaveTextNoExpire` for an entry without expiration.

Returns 1 for success, 0 for failure.

### Cache.UpdateExpirationDt

`Chilkat 11.7.0 · sqlserver · Cache · UpdateExpirationDt · method`

```sql
EXEC sp_OAMethod @cache, 'UpdateExpirationDt', @success OUT, @key, @expireDateTime
```

Replaces the expiration date and time of the cache item identified by `key` with the `CkDateTime` value supplied in `expireDateTime`. The cached data and ETag are unchanged.

**Existing item required:** This method updates metadata; it does not create a new cache entry when the key is absent.

Returns 1 for success, 0 for failure.

### Cache.UpdateExpirationStr

`Chilkat 11.7.0 · sqlserver · Cache · UpdateExpirationStr · method`

```sql
EXEC sp_OAMethod @cache, 'UpdateExpirationStr', @success OUT, @key, @expireDateTime
```

Replaces the expiration date and time of the cache item identified by `key` with the RFC 822-style Internet date string supplied in `expireDateTime`. The cached data and ETag are unchanged.

**Argument name:** Some language bindings name `key` `url`; it is the cache key and does not need to be a URL. Use `UpdateExpirationDt` for a `CkDateTime` value.

Returns 1 for success, 0 for failure.

## Deprecated members — do not use in new code

| Member | Kind | Deprecated in | Use instead |
|---|---|---|---|
| `GetExpirationDt` | method | before 11.6.1 | — |

## Related classes

[`BinData`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/sqlserver/classes/BinData.md), [`CkDateTime`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/sqlserver/classes/CkDateTime.md), [`StringBuilder`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/sqlserver/classes/StringBuilder.md)

