GitbookIO / GitbookIO/integrations
3rd party API call results get cached on Gitbook's side
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 131
- Forks
- 96
- Avg merge
- 7h 8m
- Merged PRs (30d)
- 31
Description
Context:
I'm creating an Integration that fetches data from an API to display in a block on a Gitbook page with ContentKit
Problem:
Old data keeps getting displayed, even after removing the integration completely and re-adding it. I suspect this is because Gitbook application caches the API calls en returns the cached result.
What I've tried
Cache-Control on the API call set to no-cache
Disabled the element cache with element.setCache({ maxAge: 0 });
Example:
The Linear Integration faces the same issue. When adding a ticket to a page, the data does not update after changing it in Linear.
Even after clearing local cache, trying a different browser or device
Expected behavior:
We can set the cache maxAge and it gets respected by the Gitbook application so no old data gets shown.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the stale response with a ContentKit integration and compare the API's Cache-Control setting with element.setCache({ maxAge: 0 }). Check the Linear Integration example for the same behavior; done means GitBook respects the requested cache lifetime and refreshed data appears after the source changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100