Skip to content

Fix regression on s3 fetch caches #291

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

Closed

Conversation

leonchabbey
Copy link

This aims to fix a regression from #252.
Following that PR, it became impossible to list a key of type "fetch" as the prefix in listS3Object always added a "dot" at the end which is only useful for non-fetch objects.

@changeset-bot
Copy link

changeset-bot bot commented Oct 20, 2023

⚠️ No Changeset found

Latest commit: 0381057

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel
Copy link

vercel bot commented Oct 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
open-next ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 20, 2023 5:28pm

@leonchabbey leonchabbey changed the title Fix regression s3 cache prefix fetching Fix regression on s3 fetch caches Oct 20, 2023
@khuezy
Copy link
Contributor

khuezy commented Oct 20, 2023

Thanks! Is this related to a recent latency increase others and myself have been seeing?

@leonchabbey
Copy link
Author

Thanks! Is this related to a recent latency increase others and myself have been seeing?

Most probably yes!

It couldn't find any fetch cache in S3 because the prefix never matched the structure of a fetch cache path (the path was missing __fetch and had an extra . at the end)

This problem was particularly noticeable in dynamic routes (no ISR) because it's as if there were no fetch cache at all.

@khuezy khuezy requested a review from conico974 October 23, 2023 14:54
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.

It couldn't find any fetch cache in S3 because the prefix never matched the structure of a fetch cache path (the path was missing __fetch and had an extra . at the end)

This problem was particularly noticeable in dynamic routes (no ISR) because it's as if there were no fetch cache at all.

Good catch and thanks for the PR.

Unfortunately this PR will become useless with #295. Not sure when we'll merge #295, if we wait for 2.2.6, we should merge this one for sure

@leonchabbey
Copy link
Author

It couldn't find any fetch cache in S3 because the prefix never matched the structure of a fetch cache path (the path was missing __fetch and had an extra . at the end)
This problem was particularly noticeable in dynamic routes (no ISR) because it's as if there were no fetch cache at all.

Good catch and thanks for the PR.

Unfortunately this PR will become useless with #295. Not sure when we'll merge #295, if we wait for 2.2.6, we should merge this one for sure

Nice! I actually did today a bigger refactor than this PR, quite similar to yours, while trying to understand/optimise the requests after seeing how not great to fetch performances are between a Lambda and S3 (btw I posted a question on discord about this to see if other people have seen the same thing: https://discord.com/channels/983865673656705025/1027265626085019769/1165983372590460939).

I'll close this PR then and hope yours is merged soon!

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