During my build process, I’m doing SSG rendering of ~2000 versions of the same SEO landing page. They all share the same Plasmic component that renders a simple footer. Currently I’m doing this within my getStaticProps function, so I see “Plasmic doing a fresh fetch…” 2000 times.
This seems pretty inefficient. Is there a recommended pattern for caching commonly used Plasmic components? I can think of various hacky ways to do it but would love suggestions
Here’s the relevant code within getStaticProps():
const componentNames: string[] = ["Footer Section"];
const plasmicData = await PLASMIC.fetchComponentData(...componentNames);
const compMeta = plasmicData.entryCompMetas[0];
const componentProps = {};
const { origins, month, vibes } = query;
const cityFinderData: CityFinderData = await getCityFinderData(origins, month, vibes);
return {
props: {
query,
cityFinderData,
componentNames,
compMeta,
plasmicData,
componentProps,
},
};