Set metadata inside server-side component #64366
Replies: 2 comments
-
So I just realized that if you include a |
Beta Was this translation helpful? Give feedback.
0 replies
-
There's an issue with including a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I usually need the same data to render the page content and to generate metadata, for example, the page title. Therefore, with
generateMetadata
, the same data is fetched twice in every request. I understandfetch
is cached, but I'm using Prisma. Example:Is there a way to set metadata inside
Page
? Or do this in a way wheregetPageContent
is called once? And useheaders()
insidegenerateMetadata
?If caching is to be used, keep in mind that this can be user-specific, and also host-specific (using
headers().get("host")
to determine the content to display).Thank you.
Beta Was this translation helpful? Give feedback.
All reactions