# remote-cache command

The remote-cache BASIC program increases the performance of
 updates over a network by sending groups of updates at a time.

Typically, each update made on a remote file is sent immediately to the remote site.
 Because of limitations in network throughput, this can introduce performance delays
 in batch update applications. To alleviate this issue, batch updates can be cached
 and sent in groups. This significantly improves performance almost to the same point
 as a series of local updates.

## Syntax

```
remote-cache file.reference
remote-cache file.reference 0
remote-cache file.reference {number.of.updates}
```

## Description

To turn on update-caching and/or to flush the cache, use the first syntax form.

 To turn off update-caching and to flush the cache, use the second syntax form.

 To set the number of updates to be cached before being sent, use the third syntax
 form. The higher the number of updates, the better the performance will be.

 Warning:
 The user should be aware of these warnings when using cached updates:

- Caching does not take place for binary items.

- Caching does not take place if any remote locks are held.

- Actual modification to the remote machine does not take place until the maximum number of updates fill the cache, the file is closed, a remote-cache command is executed for the file, the port drops to interactive TCL, or the port logs off. No other events flush the cache.

- Because there may be a delay in referencing updated information, it is not valid to read from a remote file which has been updated through the cache unless the file is closed or remote-cache is executed.

 Note: Executing remote-cache might be preferable because it reports
 success or failure in updating the remote machine.

---
Source: https://d3codex.com/tcl/remote-cache-command/ - part of the D3Codex reference.
