mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What? Document loading request-independent assets at module scope, and update the OG image examples to follow it. ### Why? Reading a local asset inside the component is async I/O during render, so the route defers to request time. A top-level `await` at module scope keeps the route prerendered without reaching for `use cache`. The pattern previously only lived as an inline snippet in the OG image docs. ### How? - Add an "Asynchronous I/O at module scope" section to the Cache Components guide as the canonical explanation. - Load fonts and local assets at module scope in `opengraph-image.mdx` and `image-response.mdx`, and link both to the new section. <!-- NEXT_JS_LLM_PR --> --------- Co-authored-by: Joseph <[email protected]>