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

# Caching

> How ETag-based caching works

The Python client uses **ETag-based conditional requests** to avoid re-downloading unchanged files.

## How It Works

1. On first download, the client saves the file and its ETag to `~/.cache/jmail/`
2. On subsequent requests, the client sends a conditional `HEAD` request with `If-None-Match: <etag>`
3. If the server responds with **304 Not Modified**, the cached file is used (no download)
4. If the ETag has changed, the file is re-downloaded

## Cache Location

```
~/.cache/jmail/
  emails.parquet
  emails.etag
  emails-slim.parquet
  emails-slim.etag
  documents.parquet
  documents.etag
  ...
```

## Disabling Cache

### Python

```python theme={null}
client = JmailClient(cache=False)
```

### CLI

```bash theme={null}
uv run jmail.py emails --no-cache --head 5
```

## Clearing Cache

```bash theme={null}
rm -rf ~/.cache/jmail/
```

## Manifest

The `/v1/manifest.json` endpoint provides dataset metadata and checksums, allowing programmatic freshness checks:

```bash theme={null}
curl https://data.jmail.world/v1/manifest.json | python -m json.tool
```

```python theme={null}
client = JmailClient()
manifest = client.manifest()
print(manifest)
```
