Skip to content

[Blocked by release] docs(cloudflare): skew protection #164

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Jun 24, 2025

The implementation is at opennextjs/opennextjs-cloudflare#746 for the implementation

Copy link
Contributor

@conico974 conico974 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

<Callout type="info">
Preview URLs are disabled for [Workers that implement a Durable
Object](https://developers.cloudflare.com/workers/configuration/previews/#limitations). If your app uses
Durable Objects, they will need to be implemented in a separate Worker.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add an example for this at one point.

@vicb vicb force-pushed the vicb/skew-protection branch from f69fdf5 to 8719e57 Compare July 9, 2025 14:08
@vicb
Copy link
Contributor Author

vicb commented Jul 9, 2025

Updated the PR to sync with the skew protection PR and add details about serving assets

@vicb vicb requested review from conico974 and james-elicx July 9, 2025 14:09

The following environment variables should be set when the skew protection is used:

- `CF_WORKER_NAME` should be set to the name of the worker, i.e. `my-app` given the config above
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `CF_WORKER_NAME` should be set to the name of the worker, i.e. `my-app` given the config above
- `CF_WORKER_NAME` should be set to the name of the worker, i.e. `my-app` given the config above. If you're using environment, the name of the app should contain your env, i.e. `my-app-<env>`

- Because the Worker is configured to run in front of the assets Worker (`run_worker_first`), requesting an asset will count as a request to your Worker
- Requesting an older deployment will generate 2 requests: the request to the latest version and the request to the older version
- It is not currently possible to delete a deployment
- Requests to an older deployement will be a few milli-seconds slower than requests to the latest version of the app
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Requests to an older deployement will be a few milli-seconds slower than requests to the latest version of the app
- Requests to an older deployment will be a few milli-seconds slower than requests to the latest version of the app
- Request to a deployment older than the `maxNumberOfVersions` or older than `maxVersionAgeDays` will fallback to the current deployment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants