Add gradual deployments documentation the Cf-Worker-Version-Key header.#13554
Add gradual deployments documentation the Cf-Worker-Version-Key header.#13554irvinebroque merged 5 commits intogradual-deploymentsfrom
Cf-Worker-Version-Key header.#13554Conversation
Deploying cloudflare-docs with
|
| Latest commit: |
2a63e3b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5e7727a7.cloudflare-docs-7ou.pages.dev |
| Branch Preview URL: | https://jphillips-worker-version-key.cloudflare-docs-7ou.pages.dev |
f794976 to
a1a7e87
Compare
| ``` | ||
| You should see 10 responses. Responses will reflect the content returned by the versions in your deployment. Responses will vary depending on the percentages configured in step #6. | ||
|
|
||
| ## Version keys |
There was a problem hiding this comment.
I think content should live here but we should add link to here from https://developers.cloudflare.com/workers/runtime-apis/headers/ so that if someone sees this, they look at headers docs in runtime APIs and can find it
There was a problem hiding this comment.
Yeah we probably should add something there.
We don't appear to actually have any prior art in terms of headers that can be set by users that are interpreted by the runtime, so I'll probably have to create a new section.
There was a problem hiding this comment.
Having thought about it, since the section directly linked is runtime-specific (and it's arguably an implementation detail that this header is handled by the runtime) and the page it links to specifically discusses headers added by Cloudflare, I don't think there's an obviously place to slot this. Unless you feel strongly, I'll stick with just the docs here for now.
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
| You can set the `Cf-Worker-Version-Key` header both when making an external request from the Internet to your Worker, as well as when making a subrequest from one Worker to another Worker using a [service binding](/workers/runtime-apis/bindings/service-bindings/). | ||
| ### Extracting version keys from URLs | ||
|
|
||
| If the unique identifier that you want to provide to `Cf-Worker-Version-Key` is in the URL of the incoming request, you can configure a [Ruleset Engine](/ruleset-engine/) rule on your zone to extract this key from the path or querystring, and use its value to set `Cf-Worker-Verison-Key`. This allows you to ensure version affinity, while avoiding having to modify the external client that makes the request. |
There was a problem hiding this comment.
Maybe example rule here that does basic "grab ID from URL and pop into header"?
There was a problem hiding this comment.
Sure.
I think the most likely use case will be setting the header equal to a cookie's value so probably would make most sense to show that.
I'll copy the format used in request header modification examples.
There was a problem hiding this comment.
Uh oh. It looks like this won't work right now.
I tested the ruleset engine header transformation stuff before I landed on a name for the header. It turns out ruleset engine won't let you set any headers beginning with Cf- :(
I'll have to remove the rulset engine section for now...
There was a problem hiding this comment.
I added an example that extracts the header from the URL as you originally suggested since rules engine limitations make it more complicated than it should be to extract it from a cookie (I'm pushing them to make it easier).
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Tanushree <87711021+tanushreesharma-cf@users.noreply.github.com>
Cf-Worker-Version-Key header.Cf-Worker-Version-Key header.
Cf-Worker-Version-Key header.Cf-Worker-Version-Key header.
cad0adc to
a9de2e4
Compare
|
We're postponing documentation for the version key header. I've opened a dedicated PR for gradual rollouts docs here: #13564 |
|
Reopening so that we don't forget to do this with rename |
|
I'll pick it back up now. |
Cf-Worker-Version-Key header.Cf-Worker-Version-Key header.
Cloudflare-Workers-Version-Key.
b28425b to
2a63e3b
Compare
* wip-deployments-update * first pass at docs * Apply suggestions from code review Co-authored-by: Brendan Irvine-Broque <birvine-broque@cloudflare.com> * wrangler commands & feedback * Apply suggestions from code review Co-authored-by: Jon Phillips <jonap2811@gmail.com> * Apply suggestions from code review Co-authored-by: Kate Tungusova <70746074+deadlypants1973@users.noreply.github.com> * ESM limitation, wrangler updates * Apply suggestions from code review Co-authored-by: Kate Tungusova <70746074+deadlypants1973@users.noreply.github.com> * Document gradual deployment benefit of ESM format Link to gradual deployments docs from "Migrate to ESM" page * [Workers] Remove note about D1 limitations with rollbacks (#13579) * wrangler commands and edits * Apply suggestions from code review Co-authored-by: Kate Tungusova <70746074+deadlypants1973@users.noreply.github.com> Co-authored-by: Brendan Irvine-Broque <birvine-broque@cloudflare.com> * Apply suggestions from code review PCX review * PCX edits * edits * redirects * Add gradual deployments documentation the `Cf-Worker-Version-Key` header. (#13554) * Add documentation for the `Cf-Worker-Version-Key` header. * Apply suggestions from code review * Update content/workers/configuration/versions-and-deployments/gradual-deployments.md * Apply suggestions from code review Co-authored-by: Tanushree <87711021+tanushreesharma-cf@users.noreply.github.com> * Add example of using a request header modification rule to set Cloudflare-Workers-Version-Key. --------- Co-authored-by: Brendan Irvine-Broque <birvine-broque@cloudflare.com> Co-authored-by: Tanushree <87711021+tanushreesharma-cf@users.noreply.github.com> * fixes * keywords, broken link fixes * redirect fix --------- Co-authored-by: Brendan Irvine-Broque <birvine-broque@cloudflare.com> Co-authored-by: Jon Phillips <jonap2811@gmail.com> Co-authored-by: Kate Tungusova <70746074+deadlypants1973@users.noreply.github.com> Co-authored-by: aaronlisman <83968625+aaronlisman@users.noreply.github.com> Co-authored-by: Kate Tungusova <ktungusova@cloudflare.com>
* wip-deployments-update * first pass at docs * Apply suggestions from code review Co-authored-by: Brendan Irvine-Broque <birvine-broque@cloudflare.com> * wrangler commands & feedback * Apply suggestions from code review Co-authored-by: Jon Phillips <jonap2811@gmail.com> * Apply suggestions from code review Co-authored-by: Kate Tungusova <70746074+deadlypants1973@users.noreply.github.com> * ESM limitation, wrangler updates * Apply suggestions from code review Co-authored-by: Kate Tungusova <70746074+deadlypants1973@users.noreply.github.com> * Document gradual deployment benefit of ESM format Link to gradual deployments docs from "Migrate to ESM" page * [Workers] Remove note about D1 limitations with rollbacks (#13579) * wrangler commands and edits * Apply suggestions from code review Co-authored-by: Kate Tungusova <70746074+deadlypants1973@users.noreply.github.com> Co-authored-by: Brendan Irvine-Broque <birvine-broque@cloudflare.com> * Apply suggestions from code review PCX review * PCX edits * edits * redirects * Add gradual deployments documentation the `Cf-Worker-Version-Key` header. (#13554) * Add documentation for the `Cf-Worker-Version-Key` header. * Apply suggestions from code review * Update content/workers/configuration/versions-and-deployments/gradual-deployments.md * Apply suggestions from code review Co-authored-by: Tanushree <87711021+tanushreesharma-cf@users.noreply.github.com> * Add example of using a request header modification rule to set Cloudflare-Workers-Version-Key. --------- Co-authored-by: Brendan Irvine-Broque <birvine-broque@cloudflare.com> Co-authored-by: Tanushree <87711021+tanushreesharma-cf@users.noreply.github.com> * fixes * keywords, broken link fixes * redirect fix --------- Co-authored-by: Brendan Irvine-Broque <birvine-broque@cloudflare.com> Co-authored-by: Jon Phillips <jonap2811@gmail.com> Co-authored-by: Kate Tungusova <70746074+deadlypants1973@users.noreply.github.com> Co-authored-by: aaronlisman <83968625+aaronlisman@users.noreply.github.com> Co-authored-by: Kate Tungusova <ktungusova@cloudflare.com>
No description provided.