Skip to content

Conversation

@Ked57
Copy link
Contributor

@Ked57 Ked57 commented Jun 15, 2021

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
Copy link
Member

hgwood commented Jun 16, 2021

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
Copy link
Contributor Author

Ked57 commented Jun 16, 2021

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
Copy link
Contributor Author

Ked57 commented Jun 17, 2021

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

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