We have HEADER and FOOTER components inside _app.tsx and we are using SSR and SSG. But we want to prerender html for HEADER and FOOTER components also like the pages (for effective SEO).
As we cant do use getServerSideProps and getStaticProps inside _app.tsx, we are using HEADER and FOOTER components in each and every page and calling the APIs for HEADER and FOOTER in getServerSideProps inside every page. But which is leading to render HEADER and FOOTER components in every page. So is there any way to make HEADER and FOOTER components in one file and still get prerendering for them too?