jsonresume / jsonresume.org

The mono repo that builds the homepage, utils, ui components, registry and anything else
https://jsonresume.org
68 stars 18 forks source link

stop using screenshot api #23

Open levino opened 9 months ago

levino commented 9 months ago

I just had a look at the setup for the preview images for https://jsonresume.org/themes/. The images are generated via a function using https://github.com/thomasdavis/screenshot. The results are cached for 1 day. When I look into vercels billing report, the function calls to this function still are the biggest burden on the plan. Might be the case that the data cache is too small, might be the case that these computations are very expensive. I would stop generating these images on the fly (since the themes usually will change way less often than daily) and generate them, when I rebuild the homepage / registry, because if the registry uses a new version of a theme, it can only happen, when we rebuild the registry after changes to master. In order to make this process of prerendering these images at build time easy, I would first migrate from jekyll to astro where doing things like "calling puppeteer to generate some images on build time" is a piece of cake.

thomasdavis commented 9 months ago

Sounds good. Can also just change the cache expire to two months in the interim