Skip to main content
Home
GrN.dk

Main navigation

  • Articles
  • Cases
  • Services
  • Your Digital Project Manager
  • About Greg Nowak
  • Image Gallery
  • Contact
User account menu
  • Log in

Join my community / free newsletter — sign up here

Breadcrumb

  1. Home

Cache, Background, or Batch? A Practical Map for AI Workloads

Illustrated infographic summarizing: Cache, background, batch: a cleaner map for AI workload design

By Greg Nowak. Last updated 2026-08-21.

AI systems often become slow or expensive for a reason that has little to do with model quality: every task is sent through the same request path. A support reply needed in seconds, a research job that may run for minutes, and an overnight classification run have very different operating needs.

A better design starts by classifying the work. Keep interactive requests narrow, make repeated prompt content cacheable, run suitable long jobs asynchronously, and move delay-tolerant volume into Batch. The model may stay the same; the surrounding workflow becomes much easier to operate.

Choose the lane before the model

Begin with the business promise. Does someone need the answer while looking at the screen? Can the system acknowledge the request and deliver the result later? Or can the entire job finish within a day? Those questions usually determine the right architecture more reliably than another model comparison.

Workload Best-fit pattern Typical examples What you must design
User is waiting Synchronous, cache-aware request Copilot reply, form assistance, live extraction Latency budget, fallback, concise context
May take minutes Background response Deep analysis, complex agent task Job state, polling, cancellation, notification
Can finish later Batch API Evaluations, bulk classification, embeddings Input validation, reconciliation, deletion
A practical routing matrix for deciding where an AI job belongs.

One product may need all three lanes. A customer tool could answer simple questions synchronously, accept a complex investigation as a background job, and evaluate yesterday’s conversations overnight in Batch. Splitting those paths makes service expectations, costs, and failures visible.

Make repeated prompts cache-friendly

Prompt caching is available automatically for eligible requests, but prompt structure determines whether it helps. Cache matches depend on an identical reusable prefix. Put stable instructions, tool definitions, schemas, and shared examples first; place the customer-specific data and immediate request afterwards.

Do not inflate a short prompt simply to qualify for caching. The useful target is naturally long context that is repeated frequently. Also keep timestamps, request IDs, changing tool definitions, and other variable fields out of the reusable prefix.

The details now differ by model generation. For GPT-5.6 and later, cacheable prefixes have a strict 1,024-token minimum. The API supports implicit caching and explicit breakpoints marked with prompt_cache_breakpoint. Setting prompt_cache_options.mode to explicit prevents a changing suffix from creating unnecessary cache writes. A consistent prompt_cache_key improves matching for related requests.

This matters commercially because GPT-5.6 cache writes are billed at 1.25 times the uncached input-token rate, while cache reads receive the cached-input rate. Measure both cached_tokens and cache_write_tokens. A workflow that repeatedly writes prefixes without reusing them is not an optimization.

Use background mode when one connection is too fragile

Background mode is intended for Responses API tasks that may take several minutes. Start the request with background=true, retain the response ID, and retrieve it while its status is queued or in_progress.

The important change is not the parameter; it is the contract with the calling system. The initial result means “accepted,” not “completed.” Store an internal job record linking the response ID to its customer, purpose, status, and delivery channel. Add sensible polling backoff, cancellation, expiry, idempotent completion handling, and a human-readable failure state.

The retention guidance has changed since the original version of this article. Background jobs from Zero Data Retention projects now run with store=false, but response data is still written temporarily to disk for roughly ten minutes so asynchronous execution and polling can work. That temporary state should be included in the data review rather than described as full incompatibility with ZDR.

Move delay-tolerant volume into Batch

The Batch API is the better lane when an immediate answer has no business value. OpenAI currently documents 50% lower costs than synchronous APIs, a separate and substantially larger rate-limit pool, and completion within 24 hours. Suitable jobs include evaluation suites, repository embeddings, bulk enrichment, classification, and backlog reprocessing.

Batch is a file-based operating process, not merely a cheaper loop. Each JSONL request needs a unique custom_id. Output order may differ from input order, so results must be reconciled using that ID. Validate a small sample before submitting thousands of records, retain the input and output file IDs, and handle errors at the individual-record level.

Completed work also needs a deletion routine. OpenAI’s data-control table lists application state for /v1/batches as retained until deleted. Someone should therefore own cleanup, rather than assuming a completed batch disappears automatically.

Governance and quality belong in the routing decision

“OpenAI retention” is not one universal setting. Abuse-monitoring logs, stored Responses, temporary background state, cached tensors, uploaded files, and batch objects follow different rules. Controls may also depend on the organization’s eligibility and configuration.

For each lane, record what data is sent, why it is needed, which identifiers are stored locally, who can retrieve the result, and when remote and local state are deleted. Then test the lane against its real promise: latency and fallback for interactive calls; state transitions and duplicate delivery for background work; completeness and reconciliation for Batch.

A sensible rollout sequence

  1. Inventory existing AI calls and label them interactive, long-running, or delay-tolerant.
  2. Record the latency promise, data class, expected volume, failure consequence, and owner.
  3. Stabilize reusable prompt prefixes and establish a baseline for cache reads, cache writes, latency, and cost.
  4. Pilot one background workflow with durable job state and one Batch workflow with reliable ID reconciliation.
  5. Review retention settings and deletion routines with whoever owns security and compliance.
  6. Add lane-specific operational alerts and quality checks before increasing volume.

The goal is not to use every API feature. It is to give each workload the least expensive, most dependable lane that still meets its service and governance requirements.

Need a practical workload map?

If your AI automation still forces every task through one synchronous path, Greg can help classify the work, surface the operational trade-offs, and turn the redesign into an implementable plan. Talk to Greg about your AI workflow.

Related on GrN.dk

  • OpenAI's Guardrails and Run State Make Internal Agent Rollouts a Paid Approval-and-Audit Job
  • Not Every AI Job Needs an Instant Answer: Batch the Backlog
  • AI automations need a spend dashboard before the first runaway bill

Need help with this kind of work?

Talk to Greg about your AI workflow Get in touch with Greg.

Sources

  • Prompt caching
  • Background mode
  • Batch API
  • Data controls in the OpenAI platform
Last modified
2026-08-21

Tags

  • AI automation
  • OpenAI API
  • workflow design
  • cost control
  • AI governance

Review Greg on Google

Greg Nowak Google Reviews

 

Written recommendations from Trafik og Veje, Aarhus Municipality (2011) and AgroTech (2010) — read them on LinkedIn.

Illustrated infographic summarizing: Should publishers add Google’s new Preferred Sources button?
Should publishers add Google’s new Preferred Sources button?
2026-08-24

Google’s Preferred Sources button is worth a controlled test for eligible publishers, with careful choices around placement, performance and measurement.

Illustrated infographic summarizing: Search Console Can See TikTok Now. Your Reporting Has to Catch Up
Search Console Can See TikTok Now. Your Reporting Has to Catch Up
2026-08-23

Google can now report how social profiles appear in Search. Here is how to measure cross-channel discovery without mistaking visibility for business results.

Illustrated infographic summarizing: Your AI workflow has logs. Can they explain one bad decision?
Your AI workflow has logs. Can they explain one bad decision?
2026-08-22

Logs can show that every service worked while leaving a bad AI decision unexplained. See how connected traces and careful redaction close the gap.

Illustrated infographic summarizing: Security Questionnaires Eat Into Selling Time—Let AI Find the Evidence
Security Questionnaires Eat Into Selling Time—Let AI Find the Evidence
2026-08-21

NIS 2 is generating more supplier questionnaires. A controlled AI assistant can find approved answers and sources—and route uncertain cases for review.

Illustrated infographic summarizing: Locked out of your Apple developer account? Fix it before October 1
Locked out of your Apple developer account? Fix it before October 1
2026-08-20

Apple's updated developer agreement must be accepted by October 1, 2026, and many small app owners cannot even log in. Here is where Apple's two-factor codes really go, and how to fix your access before the deadline.

Illustrated infographic summarizing: Cloudflare Workflows Now Charges by the Step—Price the Outcome
Cloudflare Workflows Now Charges by the Step—Price the Outcome
2026-08-20

Cloudflare Workflows now bills paid plans for steps and stored state. Here is how to track cost per completed outcome without weakening reliability.

Illustrated infographic summarizing: Google’s AI Search Toggle Is a Publishing Decision, Not an SEO Setting
Google’s AI Search Toggle Is a Publishing Decision, Not an SEO Setting
2026-08-19

Google’s AI Search toggle forces a commercial choice about visibility, attribution and content use. Here’s how to make that choice responsibly.

Illustrated infographic summarizing: From Supplier Invoice to Bookkeeping: AI with a Control Checkpoint
From Supplier Invoice to Bookkeeping: AI with a Control Checkpoint
2026-08-18

AI can reduce the work involved in processing supplier invoices, but reliable bookkeeping requires validation, duplicate checks, approval and a clear audit trail.

Illustrated infographic summarizing: Nginx 1.30 Changed the Upstream Defaults—Test Before You Upgrade
Nginx 1.30 Changed the Upstream Defaults—Test Before You Upgrade
2026-08-17

Nginx 1.30 defaults upstream proxying to HTTP/1.1 with keepalive enabled. Here is what to inspect, model and test before upgrading.

Illustrated infographic summarizing: OpenAI’s Assistants API Shuts Down in Ten Days. Is Your App Ready?
OpenAI’s Assistants API Shuts Down in Ten Days. Is Your App Ready?
2026-08-16

OpenAI’s Assistants API shuts down on August 26, 2026. Learn what to inventory, how to preserve state and how to cut over without breaking the product.

More articles

Built by AI — available for your business. The daily articles on this site are researched, written and illustrated by an autonomous AI pipeline. At nowa.dk I install the same kind of AI automation in businesses at fixed prices — site in Danish, English version here, and web/marketing agencies have a dedicated page.

RSS feed

Footer

  • All articles
  • Contact

GrN.dk — AI automation, web platforms, web optimization, data handling and logistics.

© 2026 GrN.dk · LinkedIn · Contact · AI automation in Danish: nowa.dk

Behind GrN.dk: Individual Entrepreneur Codecrafter · Tax ID 305669096 · Bakhtrioni St. 22, 0194 Tbilisi, Georgia · official business register