> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revoengine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# storage.compress()

> Public low-code contract, signatures and examples for storage.compress.

## `storage.compress()`

Streams an existing file to a separate .gz file in the same folder.
Awaits publication within the current executor's limits. A retry with the
same idempotency key reuses the compression session. Omit the key to use
the current source generation as the retry identity.

### Overloads

```ts theme={null}
static compress(storageEntryId: string, options?: { idempotencyKey?: string }): Promise<StorageEntryView>;

static compress(namespace: string, storageEntryId: string, options?: { idempotencyKey?: string }): Promise<StorageEntryView>;
```

### Example

```ts theme={null}
const gz = await storage.compress(file.storageEntryId, { idempotencyKey: 'daily-export-2026-11-10' });
const download = await storage.getDownload(gz.storageEntryId);
```

See [all storage methods](https://docs.revoengine.com/low-code/reference/storage.md) or [runtime basics](https://docs.revoengine.com/low-code/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.