-
-
Notifications
You must be signed in to change notification settings - Fork 109
Add hybrid memory/disk cache storages to optimise Airtable API data fetching during server initial build #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…rks when building on Vercel
[GitHub Actions] |
[GitHub Actions] |
[GitHub Actions] |
…ll by @ts-ignore-error # Conflicts: # src/utils/api/fetchAirtable.test.ts # src/utils/api/fetchJSON.test.ts
…g/production during initial build
[GitHub Actions] |
[GitHub Actions] |
[GitHub Actions] |
[GitHub Actions] |
[GitHub Actions] |
[GitHub Actions] |
[GitHub Actions] |
Issue
Fetching Airtable API performs 3 API requests per page, for each page. This generates around 140 API calls.
In-memory cache doesn't work, as it's reset between pages.
Implementation
This PR implements a hybrid memory/disk cache storage.
Initially, a memory cache had been written, but it didn't work because of the above mentioned behaviour. So, it has been extended to allow disk storage too.
Tested locally and on Vercel. Has unit tests.
See vercel/next.js#13765