gatsby-plugin-react-helmet-async
gatsby-plugin-react-helmet-async copied to clipboard
separate context for different pages with pathname
fix issue #97.
by separating contexts of each page on rendering root element in gatsby-ssr
This change appears to make sense, I just have two concerns;
- If anything relies on this data (unlikely)
- Whether this introduces a "memory leak" for larger sites, as it's now creating an object for every individual path. For a site that stores a bunch of metadata in the head across 100k pages for example, that's potentially a substantial increase in memory
thanks for your review, especially about your wise comment on memory leak
i have two question:
first, I don't understand your point in first item: If anything relies on this data (unlikely), could you please explain it more?
second, I think for using helemt async provider with 100k pages, programmer should separate it's application pages to different builds, because loading this amount of data, without using different helemt context, create memory leak in application itself. some related issue is opened yet.
by the way, what i understand from gatsby-build and gatsb-ssr api's, the best solution is to separate contexts, but if there is better solution to avoid memory leak, I'm open to apply your suggestions .
thanks,
is there any update ? please inform me if you have any consideration on my pull request
My main concern here is that this update would break any existing sites with a large number of pages, if it's causing major memory leaks. If it doesn't actually cause a large increase for a few hundred thousand pages with a normal amount of meta tags being added, I'd be okay with the change as-is
I implemented these changes and my own remarks on my own fork as I needed to get this fixed asap. We have about 30K pages but we're not really limited by memory afaik. So far everything is working but we haven't made any extensive testing