Skip to content

Commit

Permalink
adjust og image endpoint headers
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoerdbeentjes committed Mar 3, 2023
1 parent 5ebdeb9 commit e655d08
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion netlify/edge-functions/og.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ export default async function handler(req: Request) {
const authors = url.searchParams.get("authors");
const parsedAuthors = JSON.parse(authors || "[]");

return new ImageResponse(
console.log('generating image...')

const response = new ImageResponse(
(
<div
style={{
Expand Down Expand Up @@ -144,6 +146,10 @@ export default async function handler(req: Request) {
],
}
);

response.headers.set("Cache-Control", "public, max-age=31536000");

return response;
}

export const config: Config = {
Expand Down

0 comments on commit e655d08

Please sign in to comment.