> ## 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.

# キャッシュ

> ETag ベースのキャッシュの仕組み

Python クライアントは、ファイルが変更されていない場合に再ダウンロードしないよう、**ETag ベースの条件付きリクエスト**を使用します。

## 仕組み

1. 最初のダウンロード時に、クライアントはファイルとその ETag を `~/.cache/jmail/` に保存します
2. 2回目以降のリクエストでは、クライアントは `If-None-Match: <etag>` を付けた条件付きの `HEAD` リクエストを送信します
3. サーバーが **304 Not Modified** で応答した場合は、キャッシュされたファイルが使用されます（再ダウンロードは行われません）
4. ETag が変更されている場合は、ファイルが再ダウンロードされます

## キャッシュの保存先

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

## キャッシュを無効化する

### Python

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

### コマンドラインインターフェイス

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

## キャッシュの削除

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

## マニフェスト

`/v1/manifest.json` エンドポイントはデータセットのメタデータとチェックサムを返し、プログラムによる最新状態の確認を可能にします。

```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)
```


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