Skip to content

fix cache control for static page with base path#880

Draft
conico974 wants to merge 1 commit intoopennextjs:mainfrom
conico974:fix/cache-control-static-basepath
Draft

fix cache control for static page with base path#880
conico974 wants to merge 1 commit intoopennextjs:mainfrom
conico974:fix/cache-control-static-basepath

Conversation

@conico974
Copy link
Copy Markdown
Contributor

Fixes #872

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented May 25, 2025

🦋 Changeset detected

Latest commit: 6f7c130

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@opennextjs/aws Patch
app-pages-router Patch
app-router Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented May 25, 2025

Open in StackBlitz

pnpm add https://pkg.pr.new/@opennextjs/aws@880

commit: 6f7c130

if (
HtmlPages.includes(localizedPath) &&
HtmlPages.find(
(path) => `${NextConfig.basePath ?? ""}${path}` === localizedPath,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: instead of having to string concat time, you could compare to localizedPathFromBasePath that would be computed once before the loop

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ho this made me realize, this might not be correct when both i18n and basePath are set.
I'll convert this one to draft and make a release in the meantime

Copy link
Copy Markdown
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

LGTM

Suggested an optim

@conico974 conico974 marked this pull request as draft May 27, 2025 08:44
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.

Cache control headers not set for static page with base path

2 participants