Caches

LaTeX-on-HTTP caches fetched resources: when a compilation uses a file that was already fetched before (identified by the SHA-256 hash of its content), the download is skipped. These endpoints let smart clients inspect and query the cache — eg. to avoid re-uploading resources that the server already has.

Get cache metadata

GET/caches/resources

Get a view on the resources cache: size and number of cached resources (used to speed up compilations by skipping downloads).

A JSON payload with cache metadata. Cache entries are filtered (only size is returned): their content is not exposed.

curl https://latex.ytotech.com/caches/resources | python3 -m json.tool

Check cached resources

POST/caches/resources/check_cached

Check, for smart clients, whether resources (identified by their content hash) are already in the server cache.

Name Type Default Description
resources
required
list of objects — Each entry must have a hash property, formatted as sha256:<hexdigest> of the resource content.

A JSON payload mapping each hash to {"hit": true|false}.

curl -X POST https://latex.ytotech.com/caches/resources/check_cached \
    -H "Content-Type: application/json" \
    -d '{
        "resources": [
            {
                "hash": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
            }
        ]
    }'

Errors

Error code HTTP Meaning
MISSING_PAYLOAD 400 No JSON payload in the request.
MISSING_RESOURCES 400 No resources list in the payload.
MISSING_RESOURCE_HASH 400 A resource entry has no hash.

Reset the cache

DELETE/caches/resources

Empty the resources cache (eg. to force fresh downloads).

204 No Content on success.

curl -X DELETE https://latex.ytotech.com/caches/resources -v