MCPA Certification Curriculum

Cache Freshness and Cursor-Based Pagination

A cacheable result tells a client exactly how long to trust it and who else may reuse the copy; a paginated one hands back an opaque bookmark, never a page number. Name the six operations that return a CacheableResult and state what ttlMs and cacheScope mean on each one. Apply the freshness rule a 2026-07-28 client must follow: ttlMs of 0 is immediately stale, a negative value is treated as 0, and an absent field defaults to 0. Explain why cacheScope of public versus private decides who may reuse a cached response, and why that choice is never an access control decision. Walk an opaque cursor through resources/list: an absent cursor starts at the beginning, an empty string is a valid mid-list position, and an unrecognized cursor returns -32602. Explain why a listchanged notification invalidates a cache immediately regardless of remaining TTL, and why a result produced by retrying an MRTR request must never be cached. The stateless core from lesson 04 means a server never remembers a client between requests, so there is no warm connection state a client can lean on to avoid asking twice. At the same time, most of what a client asks for barely changes. A tool catalog might be edited once a week. A resource's byte content might be the same for the next…

Cache Freshness and Cursor-Based Pagination: A cacheable result tells a client exactly how long to trust it and who else may reuse the copy; a paginated one…

This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.

Browse the complete course catalog or open this lesson on GitHub.