Skip to content

Conversation

@matheusgr
Copy link
Contributor

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2025

Tagging Options

Should a new tag be published when this PR is merged?

  • 👍 for Patch 1.120.5 update
  • 🎉 for Minor 1.121.0 update
  • 🚀 for Major 2.0.0 update

const opts = fromRequest(req);
if (opts.deploymentId && deploymentId) {
if (opts.deploymentId !== deploymentId) {
throw badRequest({
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this necessary? What do you think about logging the error but not failing the request?

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we need to fail the request so a second one can cache the right response. If we dont fail will the "not failure" request be cached?

Copy link
Contributor

Choose a reason for hiding this comment

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

what if we return max-age 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already have this issue with assets. If we request an asset on a older deploy, it will give an 404.

It is better to fail fast and let the CDN cache on a successful response, and try to fix this issue with another approach.

import type { PageParams } from "../mod.ts";
import Render, { type PageData } from "./entrypoint.tsx";

const deploymentId = Deno.env.get("DENO_DEPLOYMENT_ID");
Copy link
Contributor

Choose a reason for hiding this comment

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

Will it exists in all platforms?

Copy link
Contributor

Choose a reason for hiding this comment

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

This already exists in context, shouldn't import it from context?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not on the fresh context (what is used there).

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.

6 participants