Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate OG images as WebP #7940

Merged
merged 4 commits into from May 6, 2024
Merged

Generate OG images as WebP #7940

merged 4 commits into from May 6, 2024

Conversation

delucis
Copy link
Member

@delucis delucis commented Apr 18, 2024

Description (required)

  • Updates astro-og-canvas to the latest release (required for WebP output)
  • Updates our Open Graph endpoint to output WebP images
  • Updates our helper for getting the path to a generated image to also use .webp instead of .png
  • Should reduce our cache size significantly. OG images were roughly 1 MB each on average and are now less than 10% of that.

N.B. When first building on Vercel the build was still over the build cache limit because I guess it includes all those old OG images which aren’t ever cleared out by astro-og-canvas. I reran without the cache and then it successfully cached the result with a size of only c. 250 MB. So we just need to vacate the cache once we merge this to main I suspect and we should be good to go.

But the big news is…

With a warm cache and content collection caching working as added in #7535, I got a build completing in 2m46shttps://vercel.com/astrodotbuild/docs/CTPGZ2Z2juaEqgj4xbfqqBMcxi3v

Copy link

vercel bot commented Apr 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview May 6, 2024 9:24pm
1 Ignored Deployment
Name Status Preview Updated (UTC)
docs-i18n ⬜️ Ignored (Inspect) May 6, 2024 9:24pm

@delucis delucis added the site improvement Some thing that improves the website functionality - ask @delucis for help! label Apr 18, 2024
Copy link
Member Author

@delucis delucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing some errors in the build now it redeployed with content collection caching enabled, for example on the homepage:

image

From a quick look through, it seems to all be missing CSS for components in MDX. Their JS is loading though — only styles are missing.

Something for @matthewp to maybe look at now we have this test case.

@delucis
Copy link
Member Author

delucis commented Apr 22, 2024

Update branch to bring in #7952 and now the deployment preview looks OK again!

@sarah11918
Copy link
Member

Did some checks in online preview generators and all looks good I think!

image
image
image

@delucis
Copy link
Member Author

delucis commented Apr 22, 2024

Oooh, nice work — thank you @sarah11918!

@delucis delucis merged commit 0620640 into main May 6, 2024
8 checks passed
@delucis delucis deleted the chris/compress-og-images branch May 6, 2024 21:59
wpplumber pushed a commit to wpplumber/astro-docs that referenced this pull request May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site improvement Some thing that improves the website functionality - ask @delucis for help!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants