-
-
Notifications
You must be signed in to change notification settings - Fork 636
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
Invalidate cache in production env when serving files from GitHub source #2260
Comments
In production, the Module does not revalidate its cache, and it always uses built time cache. |
@nobkd Yes. 😁 Thanks for pointing these. |
I'm trying to implement a dynamodb driver for nuxt content. I make it work in local but the build application never call dynamo. content/src/runtime/server/storage.ts Line 143 in f9a155f
const cached: any = await cacheParsedStorage.getItem(id)
if (isProduction && cached) {
return cached.parsed
}
const meta = await sourceStorage.getMeta(id)
const mtime = meta.mtime For what I can tell if isProduction it always returns the cached content and never try to get meta for eventual newest. |
I'm also running into this problem. The buildtime cache makes nuxt content unusable with non-fs drivers. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Commenting to remove stale tag |
Environment
.
Reproduction
I'm using a private GitHub repo as my source for Content module.
The app is a server app, i.e., Nitro app deployed on on Firebase Cloud Functions.
I have created a file
server/api/abc.ts
wherein it fetches fromserverQueryContent
. It serves the docs so fetched. It also has a simple Firebase authentication check, i.e., if the request header has a Authorization Bearer token, then serve the docs with x query, else serve with y query.In frontend vue page, I am using this api to fetch, i.e.,
Describe the bug
When I update the contents on my GitHub repo, the deployed production app should serve the updated version, i.e., it should automatically fetch the newer version of GitHub repo.
However, even on refreshing the page, it serves from the cached version of the repo files as on the time of running
npm run build
. I waited for 10 minutes, as it is the default TTL in unstorage module, but to no avail.Note: the authentication guard is working on the server api, i.e., the page shows x query if someone is logged in and as soon as the person logs out, y query is automatically shown. So the api is updating itself. But the api is not fetching the newer GitHub repo, but I think it is fetching from the
cache.<integritynumber].json
file even in production env.Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: