Skip to content

[WIP] Prerender stats pages for faster production builds - #85

Open
Ked57 wants to merge 3 commits into
mainfrom
prerender-stats-pages
Open

[WIP] Prerender stats pages for faster production builds#85
Ked57 wants to merge 3 commits into
mainfrom
prerender-stats-pages

Conversation

@Ked57

@Ked57 Ked57 commented Jun 15, 2021

Copy link
Copy Markdown
Contributor

This PR is motivated by the fact that statistics can be time intensive to process and don't need to be realtime accurate.

NextJS allows us to pre-render a page with data fetched at build time, data is then refetched every X seconds (I set 5 minutes in this case). This is a nice solution to make stats pages blazing fast 🚀

@hgwood: FYI since it's the nextjs server that executes the fetching this is going to require access to hasura admin secret in production

@hgwood

hgwood commented Jun 16, 2021

Copy link
Copy Markdown
Member

I've added the admin secret of the production instance of Hasura to the environment variables of the production instance of the app (as HASURA_ADMIN_SECRET to match the code in the PR).

@Ked57

Ked57 commented Jun 16, 2021

Copy link
Copy Markdown
Contributor Author

I've added the admin secret of the production instance of Hasura to the environment variables of the production instance of the app (as HASURA_ADMIN_SECRET to match the code in the PR).

Thanks a lot 🙏

@Ked57
Ked57 force-pushed the prerender-stats-pages branch from 3563206 to 3227048 Compare June 17, 2021 13:30
@Ked57

Ked57 commented Jun 17, 2021

Copy link
Copy Markdown
Contributor Author

This works well in production build mode but freezes the dev build. The problem that this PR would help solve is already being well mitigated by #84. I will not merge this for now until I find a solution to the dev build freeze problem

@GweltazNiquel
GweltazNiquel requested a review from a team as a code owner September 6, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request front

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants