new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Cloudflare Workers · all subjects

cache/cache-keys

3 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Cache key includes request path, entrypoint, and ctx.props

The cache key includes the request path, the target entrypoint, and the invocation's ctx.props. Two requests that look the same may produce different cache keys if any of these differ. Common causes of cache misses: URL path or query string differs (even trailing slashes matter), the calling Worker passes different ctx.props for each request (for example, different user ID), or requests hit different named entrypoints of the same Worker.

Multi-tenant safety with ctx.props

Use ctx.props for per-caller authorization context to prevent callers from receiving each other's cached responses. If callers are receiving each other's responses and you use ctx.props, one of the following is true: (1) You are authenticating callers with a header or query parameter not part of the cache key - move authorization input into ctx.props, or (2) You are calling a service binding with a user-specific query parameter that differs between callers - ensure each caller's request path actually differs.

Cache key components for Workers

Workers Cache is keyed by the request path, entrypoint, ctx.props, and by default the Worker version, not by hostname. A Worker bound to multiple domains serves the same cached responses to all of them.

Give your agent this brain