-
Notifications
You must be signed in to change notification settings - Fork 87
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
feat: configure ssr handler to only match known routes #2705
Draft
orinokai
wants to merge
3
commits into
main
Choose a base branch
from
rs/ssr-invocations
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
orinokai
changed the title
feat: configure ssr handler to match known routes only
feat: configure ssr handler to only match known routes
Nov 15, 2024
📊 Package size report 0.03%↑
Unchanged files
🤖 This report was automatically generated by pkg-size-action |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Previously, the SSR handler has been configured to catch all routes, which ensures it can back any route with server side rendering and means we don't have to handle the routing logic at the edge.
However, this approach also causes the SSR handler to be invoked for paths that are not valid routes. This is a problem when there are many requests to these paths, e.g. in the case of a bot or bad actor.
This PR parses out a superset of valid routes from the
routes-manifest.json
and configures the SSR handler to match on only these paths. Currently it is a just a PoC and there are a number of assumptions and questions to be answered, as well as remaining test failures for use cases such as API routes, data routes, etc.Tests
New routing tests added
Relevant links (GitHub issues, etc.) or a picture of cute animal