Closed
Description
populate cache
The command opennextjs-cloudflate populateCache
populates a bucket named NEXT_INC_CACHE_R2_BUCKET
.
NEXT_INC_CACHE_R2_BUCKET
is actually the name of the binding rather than the bucket.
We probably should use getPlatformProxy()
to retrieve the binding and call .put()
on it. The command should take an env a directory to persist data.
cache handler
getR2Key
returns ${directory}/${process.env.NEXT_BUILD_ID ?? "no-build-id"}/${key}.${isFetch ? "fetch" : "cache"}
The key
is typically /path/to/file.cache
so we will end up with BUILD_ID//key
which will not match the uploaded file.
@james-elicx thoughts?
Edit: found while tackling #528
Metadata
Metadata
Assignees
Labels
No labels