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

> Come funziona la cache basata su ETag

Il client Python usa **richieste condizionali basate su ETag** per evitare di scaricare nuovamente i file non modificati.

## Come funziona

1. Al primo download, il client salva il file e il suo ETag in `~/.cache/jmail/`
2. Per le richieste successive, il client invia una richiesta `HEAD` condizionale con `If-None-Match: <etag>`
3. Se il server risponde con **304 Not Modified**, viene usato il file dalla cache (nessun download)
4. Se l'ETag è cambiato, il file viene scaricato di nuovo

## Percorso della cache

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

## Disabilitare la cache

### Python

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

### Interfaccia a riga di comando (CLI)

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

## Svuotare la cache

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

## Manifest

L'endpoint `/v1/manifest.json` fornisce i metadati dei dataset e i checksum, consentendo verifiche automatiche dello stato di aggiornamento:

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