estuary / marketing-site

0 stars 5 forks source link

Improve build time #170

Open flavioriper opened 9 months ago

flavioriper commented 9 months ago

Problems

Images

Not caching images at all. This means they are downloaded AND optimized every build.

Pages

Again - we have a lot of something without cache.

Create Pages call having long running query

warning Your GraphQL query in createPages took 19.641 seconds which is an unexpectedly long time. See https://gatsby.dev/create-pages-performance for tips on how to improve this.
success createPages - 22.947s
success createPagesStatefully - 0.487s

Solutions

Image Processors

Possibly use an image hosting services that "automagically" handles this for us. Would be best if that could work with Strapi as is.

Caching

Would be great if we could cache more stuff that is handled every build. However, this was tried before and cause some issues. Still need to find out exactly why there were issues.

Chunking

We could look into breaking the build up a bit more. This could be especially helpful for content changes since we should have an idea of what pages could change. However, chunking might end up just getting us the exact same thing as caching but with a lot more steps / manual work

Review queries

Could take a look at queries and ensure we are only ever fetching the necessary data.


Notes

The document BUILD OPTIMIZATION SPYKE.pdf was written for https://github.com/estuary/marketing-site/issues/172

altitude-lucas commented 2 months ago

@travjenkins is this still relevant?

travjenkins commented 2 months ago

Yeah - but it'll probably take some time to get done. I think it is pretty low priority as we've been okay with longer build times so far.

travjenkins commented 1 month ago

@altitude-lucas I'm gonna pull this from the official backlog... I feel like there is a mountain of work that can be done before this is ever picked up.

travjenkins commented 1 week ago

Things to think about:

  1. Enabled caching for Gatsby
  2. Incremental builds: https://dev.to/bytesizedcode/speed-up-your-gatsby-application-s-build-time-by-300-with-incremental-builds-3bhe
  3. Bump node version on actions (might help?)
  4. Look for optimizations in our code base (rehype, etc.)