Cache Control
Cache control allows you to configure caching behavior for parsing operations, controlling whether results are cached and whether existing cache should be invalidated.
How It Works
Section titled “How It Works”By default, LlamaParse caches parsing results to improve performance on repeated requests. Cache control allows you to disable this caching when you need fresh results or want to ensure no cached data is used.
Available Options
Section titled “Available Options”Disable Cache
Section titled “Disable Cache”Disable caching for the current parsing request. This both prevents caching of new results and invalidates any existing cache.
{ "disable_cache": true}Enable Cache (Default)
Section titled “Enable Cache (Default)”Allow normal caching behavior. This is the default setting when the parameter is not specified.
{ "disable_cache": false}Use Cases
Section titled “Use Cases”- Fresh Results: Ensure LlamaParse processes the document anew each time
- Testing: Get consistent results during development and testing
- Performance Testing: Measure parsing performance without cache influence
- Debugging: Isolate parsing issues by eliminating cached results
Complete API Request Example
Section titled “Complete API Request Example”curl -X 'POST' \ 'https://api.cloud.llamaindex.ai/api/v2/parse' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \ --data '{ "file_id": "<file_id>", "tier": "agentic", "version": "latest", "disable_cache": true }'from llama_cloud import LlamaCloud
client = LlamaCloud(api_key="LLAMA_CLOUD_API_KEY")
result = client.parsing.parse( upload_file="example_file.pdf", tier="agentic", version="latest", expand=["markdown"], disable_cache=True)import fs from "fs";import { LlamaCloud } from "@llamaindex/llama-cloud";
const client = new LlamaCloud({ apiKey: "LLAMA_CLOUD_API_KEY",});
const result = await client.parsing.parse({ upload_file: fs.createReadStream('example_file.pdf'), tier: "agentic", version: "latest", expand: ["markdown"], disable_cache: true});