Skip to content
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

perf: deny SSR rendering when accept headers do not match #465

Merged
merged 2 commits into from
Nov 23, 2020

Conversation

dhhyi
Copy link
Collaborator

@dhhyi dhhyi commented Nov 20, 2020

PR Type

[x] Other: Performance Improvement

What Is the Current Behavior?

Requests for static resources, that don't exist, trigger an SSR rendering cycle which renders the error page.

What Is the New Behavior?

The request accept headers are used to determine if the browser was expecting an html response. If the static resource was referenced in an img src, link or script tag, the browser doesn't explicitly request html content. This can be used to short-cut the 404 response and not trigger SSR.

Does this PR Introduce a Breaking Change?

[ ] Yes
[x] No

Other Information

https://developer.mozilla.org/de/docs/Web/HTTP/Headers/Accept

@dhhyi dhhyi added the enhancement Enhancement to an existing feature label Nov 20, 2020
@dhhyi dhhyi added this to the 0.26 milestone Nov 20, 2020
@dhhyi dhhyi self-assigned this Nov 20, 2020
@dhhyi dhhyi force-pushed the perf/ssr-shortcut-for-accept-mismatch branch from 1d9f18d to 2a0efe9 Compare November 20, 2020 13:09
@dhhyi dhhyi requested a review from MaxKless November 23, 2020 09:22
MaxKless
MaxKless previously approved these changes Nov 23, 2020
@dhhyi dhhyi merged commit 2b81911 into develop Nov 23, 2020
@dhhyi dhhyi deleted the perf/ssr-shortcut-for-accept-mismatch branch November 23, 2020 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants