Skip to content

refactor(cloud-function): extract REVIEW_ROUTING + CACHE_DISABLED#320

Open
caugner wants to merge 1 commit intomainfrom
200-split-wildcard-enabled-flag
Open

refactor(cloud-function): extract REVIEW_ROUTING + CACHE_DISABLED#320
caugner wants to merge 1 commit intomainfrom
200-split-wildcard-enabled-flag

Conversation

@caugner
Copy link
Copy Markdown
Contributor

@caugner caugner commented Apr 29, 2026

Description

Replaces the WILDCARD_ENABLED environment variable by two variables REVIEW_ROUTING and CACHE_DISABLED.

Motivation

Make the environment variable names clearer, and separate the two purposes.

Additional details

Related issues and pull requests

Fixes #200.

Replaces the `WILDCARD_ENABLED` environment variable.
@caugner caugner requested a review from a team as a code owner April 29, 2026 16:37
@caugner caugner requested a review from LeoMcA April 29, 2026 16:37
const response = await fetch(`${target}${locale}/404/index.html`);
notFoundBuffer = response.arrayBuffer();
if (!WILDCARD_ENABLED) {
if (!CACHE_DISABLED) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This feels more like REVIEW_ROUTING rather than CACHE_DISABLED: we are disabling a cache, but it's not anything to do with the cache-control header.

Suggested change
if (!CACHE_DISABLED) {
if (!REVIEW_ROUTING) {

Presumably we do this to allow some aspect of review routing to work, and don't need to enable it independently?

Comment thread cloud-function/README.md
- `REVIEW_ROUTING` (default: `false`) - If enabled, accepts any `Host` header
value, uses the leftmost subdomain to route into a subdirectory of
`SOURCE_CONTENT`, and falls back to production for missing assets.
- `CACHE_DISABLED` (default: `false`) - If enabled, disables response caching
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Needs updating if the above change is accepted.

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.

Rename WILDCARD_ENABLED flag

3 participants