8000 GitHub · Where software is built
[go: up one dir, main page]

Skip to content
[BUG] R2 cache population #535
Closed
@vicb

Description

@vicb

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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0