{"_self":{"principle":"Self-explaining payload — no external context required. This _self block describes what you are reading and where to look next.","widget":"article_bundle","feature":"bundle","name":"LLM article bundle","what":"Paste-ready package: body + claims + sources + voxels + provenance + manifest + constitution.","contains":"body, claims, sources, voxels, provenance, question graph, constitution, llm_manifest","slug":"oip-what-is-caching","urls":{"read":"https://miscsubjects.com/api/articles/oip-what-is-caching/bundle?format=markdown"},"how_to_use":"Paste into any LLM. Read §SELF first. Write back via ingest or claim endpoints in llm_manifest.","write":null,"imessage":null,"router_tag":null,"proof_chain":[{"step":1,"claim":"Articles are voxel graphs of tiered claims, not prose blobs.","verify":"https://miscsubjects.com/api/articles/constitution"},{"step":2,"claim":"Claims link to hash-chained sources via source_ids.","verify":"https://miscsubjects.com/api/articles/oip-what-is-caching/sources"},{"step":3,"claim":"Ask reads topology; ingest/claim append to ledger.","verify":"https://miscsubjects.com/api/protocol"},{"step":4,"claim":"Models queue growth: populate → collaborate → repair → reflex.","verify":"https://miscsubjects.com/api/protocol/grow"},{"step":5,"claim":"Graph proves its own shape (reflex) and $/claim (yield).","verify":"https://miscsubjects.com/graph.html?layer=reflex"},{"step":6,"claim":"Full feature index + _explain on every API response.","verify":"https://miscsubjects.com/api/articles/system-map"}],"related_features":[{"id":"topology","name":"Article topology","what":"Claims, sources, anecdotes, user reports, related embeds, question graph slice — for ask/ROUTER.","urls":{"read":"https://miscsubjects.com/api/articles/oip-what-is-caching/topology"}},{"id":"voxels","name":"Voxel graph","what":"Claims as atoms, sources as edges (supported_by, posted_by). Per-claim provenance.","urls":{"read":"https://miscsubjects.com/api/articles/oip-what-is-caching/voxels","write":"https://miscsubjects.com/api/protocol/claim"}},{"id":"ask","name":"Ask protocol","what":"Answer only from topology; creates question_node with gaps and ingest_hint.","urls":{"read":"https://miscsubjects.com/api/articles/oip-what-is-caching/prompts","write":"https://miscsubjects.com/api/protocol/ask"}},{"id":"ingest","name":"Ingest protocol","what":"Parse pasted evidence → source ledger + claims + evidence_ingest node.","urls":{"write":"https://miscsubjects.com/api/protocol/ingest"}},{"id":"claim_post","name":"Claim post protocol","what":"Prompt-injection style POST — one claim voxel with who_claims + posted_by.","urls":{"read":"https://miscsubjects.com/api/articles/oip-what-is-caching/voxels","write":"https://miscsubjects.com/api/protocol/claim"}},{"id":"llm_manifest","name":"LLM manifest","what":"Machine-readable read/write contract for external LLMs.","urls":{"read":"https://miscsubjects.com/api/articles/llm-manifest"}}],"system_map":"https://miscsubjects.com/api/articles/system-map","system_map_markdown":"https://miscsubjects.com/api/articles/system-map?format=markdown","not_medical_advice":true},"_explain":{"feature":"bundle","name":"LLM article bundle","what":"Paste-ready package: body + claims + sources + voxels + provenance + manifest + constitution.","why":"Every feature is auditable collective intelligence","how":"Paste into any LLM. Read §SELF first. Write back via ingest or claim endpoints in llm_manifest.","model":null,"verifies":null,"urls":{"read":"https://miscsubjects.com/api/articles/oip-what-is-caching/bundle?format=markdown"},"imessage":null,"router":null,"related":[{"id":"topology","what":"Claims, sources, anecdotes, user reports, related embeds, question graph slice — for ask/ROUTER."},{"id":"voxels","what":"Claims as atoms, sources as edges (supported_by, posted_by). Per-claim provenance."},{"id":"ask","what":"Answer only from topology; creates question_node with gaps and ingest_hint."},{"id":"ingest","what":"Parse pasted evidence → source ledger + claims + evidence_ingest node."},{"id":"claim_post","what":"Prompt-injection style POST — one claim voxel with who_claims + posted_by."},{"id":"llm_manifest","what":"Machine-readable read/write contract for external LLMs."}],"not_medical_advice":true},"bundle_version":1,"generated_at":"2026-07-04T22:35:09.273Z","slug":"oip-what-is-caching","title":"What Is Caching","url":"https://miscsubjects.com/a/oip-what-is-caching","register":"oip_protocol","tags":["oip","protocol"],"posted_at":"2026-07-04T18:30:23.699Z","updated_at":"2026-07-04T19:01:10.700Z","body":"## What It Is\n\n**Caching stores the result of expensive work so you never pay the same cost twice.** It is a deterministic shortcut: compute once, serve many. Every cache entry is a contract — a promise that the stored value is faster to retrieve than the source of truth, and a promise that it will be invalidated when that truth changes.\n\n## Why It Matters\n\nWithout caching, every request hits the source of truth. Every database query, every API call, every disk read. This is correct. It is also ruinously slow.\n\nCaching exists because the world has two truths: the truth that exists, and the truth that is fast enough to use. They are not always the same. The gap between them is the cost of certainty.\n\nIn OIP systems, this gap is not a bug. It is an explicit contract. The build does not pretend every cache hit is a live query. It states: *this value is cached at time T, valid until invalidated by event E.* That is honesty. That is auditability. A system that hides its cache is lying. A system that declares its cache is a protocol.\n\nPractically, caching turns hardware constraints into predictable performance. A millisecond disk read becomes a nanosecond memory read. A cross-continent API call becomes a local hash lookup. The difference is not marginal. It is the difference between a system that scales and one that collapses under its own load.\n\n## How It Works\n\n**Step 1: The miss.** A request arrives. The cache is checked. No entry exists. The system does the expensive work: queries the database, computes the result, fetches from origin.\n\n**Step 2: The store.** The result is written to the cache with a key — typically a deterministic hash of the request parameters. This key is the contract identifier.\n\n**Step 3: The hit.** A subsequent identical request arrives. The cache key is recomputed. The stored result is returned instantly. No database query. No network round-trip. No computation.\n\n**Step 4: The invalidation.** The source of truth changes. A database row updates. A file is edited. The cache must be purged or updated. This is the hard part. Every caching system lives or dies on its invalidation logic.\n\n**Step 5: The eviction.** The cache reaches its capacity limit. An old or unused entry is removed to make room. This is a mechanical, not logical, event. The entry is not wrong; it is merely less important.\n\nConcrete example: a blog serves a popular article. The first reader triggers a database query, a template render, and a response. The rendered HTML is stored in a cache with key `article:123`. The next 10,000 readers receive the cached HTML in microseconds. When the author edits the article, the key `article:123` is invalidated. The next reader triggers a fresh render.\n\n## The Contract\n\nA cache is defined by four parameters:\n\n| Parameter | Meaning |\n|-----------|---------|\n| **Key** | A deterministic identifier that uniquely maps to the stored result. |\n| **Value** | The result of the expensive computation. |\n| **TTL (Time to Live)** | The maximum duration the value is considered valid without revalidation. |\n| **Invalidation Trigger** | The event or condition that forces immediate removal or update of the entry. |\n\nIn OIP, these four parameters are not implementation details. They are the public contract. Every cache entry must be traceable to its origin, its TTL must be explicit, and its invalidation must be observable in the ledger.\n\n## Real Examples\n\n**Redis in a web application.** A user profile is fetched from PostgreSQL, serialized, and stored in Redis with a 60-second TTL. Every profile view in that minute reads from Redis. The user updates their bio; the application invalidates the Redis key `user:profile:8472` immediately. The next read is a cache miss, fetches from PostgreSQL, and repopulates Redis.\n\n**CDN edge caching.** A static JavaScript bundle is served from a Cloudflare CDN. The origin server in Virginia is the source of truth. A user in Tokyo requests the file. The first Tokyo request travels to Virginia. The file is cached at the Tokyo edge. The next 100,000 Tokyo requests are served from the local edge node. The cache key is the file path plus a content hash. When the build deploys a new version, the hash changes, and the edge cache is naturally bypassed.\n\n**CPU L1 cache.** A processor executes `x = array[i]`. The data is not in the L1 cache. The CPU stalls for 100 cycles to fetch from RAM. The value is stored in L1. The next 10 instructions reference the same value. Each is served in 3 cycles. The hardware cache is invisible to the programmer, but the contract is identical: expensive fetch once, cheap access thereafter.\n\n**DNS caching.** A browser resolves `example.com` to `93.184.216.34`. The operating system caches this mapping for the TTL specified in the DNS record (e.g., 300 seconds). Every subsequent request to `example.com` in that window uses the cached IP. The registrar changes the A record; the old TTL governs how long stale resolutions persist across the internet.\n\n**HTTP ETag caching.** A client requests an API resource. The server responds with an `ETag: \"abc123\"` header. The client caches the response and the ETag. On the next request, the client sends `If-None-Match: \"abc123\"`. The server responds `304 Not Modified` with no body. The client uses its cached copy. No data transferred. One header comparison. The contract is: the server promises the ETag changes when the resource changes.\n\n## Common Mistakes\n\n**Cache without invalidation.** A system caches aggressively and never invalidates. The data grows stale. Users see wrong states. The system becomes a lie machine.\n\n**Cache without a contract.** The cache TTL is implicit, buried in configuration, or undocumented. No one knows how stale the data is. Debugging becomes archaeology.\n\n**Cache the wrong layer.** A developer caches the output of a function that already contains cached database calls. The double cache creates nested TTL problems and stale data cascades. Cache the expensive layer, not the cheap one.\n\n**Thundering herd.** The cache expires. A thousand requests arrive simultaneously. Every one misses the cache and hits the database. The database collapses. Solution: per-request revalidation, stale-while-revalidate, or probabilistic early expiration.\n\n**Treating cache as source of truth.** The cache is a performance layer. It is not the ledger. If the cache and the database disagree, the database wins. Any system that treats cache as truth has a consistency bug.\n\n## Connection to OIP\n\nOIP is the Open, Deterministic, Auditable Protocol. Caching is not a peripheral optimization in OIP. It is a first-class concern precisely because it is a source of hidden state.\n\n**Open:** Every cache policy is declared. TTLs are visible. Invalidation logic is explicit. There is no hidden cache that silently changes behavior.\n\n**Deterministic:** The same input yields the same cache key. The same cache key yields the same result within its TTL. The contract is reproducible. A cache hit is not random luck; it is a predictable outcome of a deterministic hash.\n\n**Auditable:** Every cache miss, hit, and invalidation is a candidate for the ledger. The build logs when a value was cached, when it was hit, and when it was purged. A cache is not a black box. It is a traceable component of the system's observable state.\n\nIn OIP, caching is not a trick to make things faster. It is a disciplined trade between speed and certainty, governed by explicit contracts that the system can read, verify, and audit. A cache is a promise. OIP keeps promises.\n\n## Connection to the Grain Philosophy\n\nThis protocol is part of the [Open Inventory Protocol](/a/philosophy) — a living system of self-describing voxels that serves the Grain philosophy. The OIP is the interface. The philosophy is the core.\n","claims":[],"sources":[],"voxels":{"slug":"oip-what-is-caching","counts":{"voxels":0,"sources":0,"edges":0},"note":"slim bundle — full voxels at /api/articles/oip-what-is-caching/voxels"},"constitution":{"url":"https://miscsubjects.com/api/articles/constitution"},"provenance":[],"contributions":[],"topology":null,"slim":true,"ledger_totals":{"claims":0,"sources":0,"exported_claims":0,"exported_sources":0},"question_graph":{"slug":"oip-what-is-caching","questions":[],"evidence":[],"edges":[],"counts":{"questions":0,"evidence":0,"edges":0}},"verification":{"provenance":{"valid":true,"entries":0,"head":"genesis"},"sources":{"valid":true,"entries":0,"head":"genesis"}},"counts":{"claims":0,"sources":0,"provenance":0,"contributions":0,"questions":0,"evidence_ingests":0,"voxel_edges":0},"llm_manifest":{"version":"1","site":"https://miscsubjects.com","purpose":"Peptide evidence articles with hash-chained source ledgers, tiered claims, and a question graph. LLMs should READ bundles/URLs and WRITE back via ingest — never invent doses.","read":{"human_page":"https://miscsubjects.com/a/oip-what-is-caching","bundle_json":"https://miscsubjects.com/api/articles/oip-what-is-caching/bundle","bundle_markdown":"https://miscsubjects.com/api/articles/oip-what-is-caching/bundle?format=markdown","topology":"https://miscsubjects.com/api/articles/oip-what-is-caching/topology","question_graph":"https://miscsubjects.com/api/articles/oip-what-is-caching/question-graph","sources":"https://miscsubjects.com/api/articles/oip-what-is-caching/sources","provenance":"https://miscsubjects.com/api/articles/oip-what-is-caching/provenance","contributions":"https://miscsubjects.com/api/articles/oip-what-is-caching/contributions","graph_topology":"https://miscsubjects.com/api/articles/oip-what-is-caching/graph-topology?question={question}","voxels":"https://miscsubjects.com/api/articles/oip-what-is-caching/voxels","constitution":"https://miscsubjects.com/api/articles/constitution","ontology":"https://miscsubjects.com/api/articles/ontology","system_map":"https://miscsubjects.com/api/articles/system-map","system_map_markdown":"https://miscsubjects.com/api/articles/system-map?format=markdown","health":"https://miscsubjects.com/api/articles/oip-what-is-caching/health","repair":"POST https://miscsubjects.com/api/protocol/repair","list_articles":"https://miscsubjects.com/api/articles","graph_canvas":"https://miscsubjects.com/graph.html?slugs=oip-what-is-caching","graph_yield":"https://miscsubjects.com/api/graph?slugs=oip-what-is-caching&layer=yield","obsidian_vault":"https://miscsubjects.com/api/articles/obsidian-vault?slugs=oip-what-is-caching","graph_query":"https://miscsubjects.com/api/v1/query?from=oip-what-is-caching&kind=claim&where=tier=human"},"ask":{"description":"Answer only from topology; creates a question_node with gaps.","api":"POST https://miscsubjects.com/api/protocol/ask","body":{"slug":"{slug}","question":"string"},"imessage":"oip-what-is-caching|your question","router_tag":"[ARTICLE_ASK]oip-what-is-caching|question[/ARTICLE_ASK]","auth":"x-terminal-key header for API; iMessage/WhatsApp via miscsubjects build"},"ingest":{"description":"Parse pasted evidence → source ledger + claims + evidence_ingest node.","api":"POST https://miscsubjects.com/api/protocol/ingest","body":{"slug":"{slug}","evidence":"paste text","question_node_id":"optional qn_..."},"imessage":"ingest oip-what-is-caching|q:{node_id}|paste evidence","router_tag":"[ARTICLE_INGEST]oip-what-is-caching|evidence[/ARTICLE_INGEST]","tiers":["human","preclinical","anecdotal","mechanistic","speculative"]},"claim":{"description":"Prompt-injection style POST — one claim voxel with who_claims + posted_by provenance.","api":"POST https://miscsubjects.com/api/protocol/claim","body":{"slug":"{slug}","text":"one assertion","tier":"human|preclinical|anecdotal|mechanistic|speculative","who_claims":"study author, platform, or model id","source_ids":"optional [s1]"},"imessage":"claim oip-what-is-caching|tier|assertion — who claims it?","router_tag":"[ARTICLE_CLAIM]oip-what-is-caching|tier|assertion[/ARTICLE_CLAIM]","slots":["what_it_is","who_claims_what","what_is_known","what_is_unknown","mechanism","limitations","disclaimer"]},"tiers":{"human":0.8,"preclinical":0.5,"anecdotal":0.3,"mechanistic":0.3,"speculative":0.1},"invariants":["Self-explaining — every API JSON has _self; every paste widget has §SELF; root index at /api/articles/system-map","Append-only — revisions preserved at ?rev=n","Source chain verifies integrity, not truth","Answers must cite claim ids and source ids from topology","Not medical advice"],"constitution":{"version":1,"principle":"Articles are voxel graphs of claims — not prose blobs. Every assertion is a claim atom with tier, weight, source_ids, and posted_by provenance.","slots":[{"id":"what_it_is","required":true,"answers":"What is this peptide/stack/condition?"},{"id":"who_claims_what","required":true,"answers":"Who claims what — study authors, platforms, n=?"},{"id":"what_is_known","required":true,"answers":"What is known with tier labels (human/preclinical/anecdotal)"},{"id":"what_is_unknown","required":true,"answers":"What is NOT known — explicit gaps"},{"id":"mechanism","required":false,"answers":"Proposed mechanism (mechanistic tier only)"},{"id":"limitations","required":true,"answers":"Limits of evidence — no dose advice"},{"id":"disclaimer","required":true,"answers":"Not medical advice"}],"claim_rules":["One claim = one falsifiable assertion. No compound claims.","Every claim must declare tier: human|preclinical|anecdotal|mechanistic|speculative|system.","system tier = architecture/design axioms (not biological mechanism). Use for protocol self-definition.","Sourced claims must cite source_ids from the hash-chained ledger.","Unsourced claims must set source_status: unsourced and why_material.","posted_by is mandatory on every new claim (model id, human, or channel).","No medical advice, no doses, no 'you should take'.","Bad information is retracted (status:retracted), never deleted — retraction event stays on ledger.","Adversary challenges link via challenges[] / challenged_by[] — target may be downweighted.","Leaked secrets are scrubbed to [REDACTED:secret-leak] with scrub_events tombstone — honest audit trail."],"source_rules":["Every source is a voxel edge: type, url, exact quote, summary, found_by, accessed_at.","Sources hash-chain — prev/hash on append.","Anecdotal sources must name platform (reddit|x|youtube|imessage|user_entry)."],"ontology_rules":["Peptide articles (bpc-157, tb-500) are tree roots.","Condition articles (bpc-157-glp1-gut-damage) branch from peptides.","Stack articles (wolverine-stack-glp1) compose peptides — never duplicate peptide mechanism prose.","If an article has no parent embeds and is not a root peptide → sprawl candidate.","Misstep = duplicate scope with another slug; merge or reparent via embeds."],"post_protocol":{"claim":"POST /api/protocol/claim","source":"POST /api/protocol/sources","ingest":"POST /api/protocol/ingest","webhook":"POST /api/articles/<slug>/webhook {kind:claim|source}","imessage_claim":"claim {slug}|{tier}|your assertion — who claims it, source?","imessage_ingest":"ingest {slug}|evidence paste"}},"this_article":{"slug":"oip-what-is-caching","url":"https://miscsubjects.com/a/oip-what-is-caching","bundle_url":"https://miscsubjects.com/api/articles/oip-what-is-caching/bundle?format=markdown"}},"api_urls":{"bundle":"https://miscsubjects.com/api/articles/oip-what-is-caching/bundle","bundle_markdown":"https://miscsubjects.com/api/articles/oip-what-is-caching/bundle?format=markdown","topology":"https://miscsubjects.com/api/articles/oip-what-is-caching/topology","voxels":"https://miscsubjects.com/api/articles/oip-what-is-caching/voxels","constitution":"https://miscsubjects.com/api/articles/constitution","ontology":"https://miscsubjects.com/api/articles/ontology","question_graph":"https://miscsubjects.com/api/articles/oip-what-is-caching/question-graph","ask":"https://miscsubjects.com/api/protocol/ask","ingest":"https://miscsubjects.com/api/protocol/ingest","claim":"https://miscsubjects.com/api/protocol/claim","system_map":"https://miscsubjects.com/api/articles/system-map","system_map_markdown":"https://miscsubjects.com/api/articles/system-map?format=markdown"}}