-
Notifications
You must be signed in to change notification settings - Fork 1
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
reduce cloudfront cost (move collection processing to server-side) #871
reduce cloudfront cost (move collection processing to server-side) #871
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Datadog ReportBranch report: ✅ 0 Failed, 184 Passed, 34 Skipped, 38.8s Total Time |
Using moh-corp PROD data for benchmarking
based on my calculation, should reduce our overall Cloudfront cost by 50% (a few hundred bucks a month) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't have an issue with this PR and i am ok to approve it, however i don't quite understand why this helps!
i thought we would precompute on the server side and this is done through removing site
and getting the final output for imageSrc
and imageTitle
?
packages/components/src/templates/next/layouts/Collection/Collection.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/templates/next/layouts/Collection/Collection.tsx
Show resolved
Hide resolved
@seaerchin yup but previously I only prioritize that change for components that are more universal e.g. navbar. The change wasn't made for Collection since it was only a few page |
…oudfront-cost-for-collection-layout
…ngohjw/reduce-cloudfront-cost-for-collection-layout
Problem
Cloudfront cost should not be as high based on our current traffic
A sizeable portion comes from serving huge collection layout
Solution
Breaking Changes
Improvements:
move as much client-side rendering to server-side to be processed during build time. This reduces the need to
sitemap
using
moh-corp
archived repo of just 200+ collection items, this reduces the HTML file from 1.28MB to 520kb (40% reduction). With larger site like actual moh-corp PROD, it should be much more significant.And with current CF actual usage, quick napkin math says it can reduce by at least 20% (will be much more)
note - shifted stories from CollectionCard to Collection