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

fix: perform server-side rendering only when user-agent is a bot #1744

Merged
merged 16 commits into from
Feb 5, 2024
Merged

Conversation

harshdoesdev
Copy link
Contributor

@harshdoesdev harshdoesdev commented Feb 2, 2024

We should perform SSR only when the user-agent is a bot, otherwise we can skip the SSR step for normal users. It reduces the server response time from 3.7s to 1.5s (tested on fastn.com served locally).

@amitu
Copy link
Contributor

amitu commented Feb 2, 2024

@harshdoesdev, write a test for this also somehow.

@amitu
Copy link
Contributor

amitu commented Feb 3, 2024

@harshdoesdev we have to make sure SSR happens when we are doing fastn build. Can you confirm that is the case?

@amitu
Copy link
Contributor

amitu commented Feb 3, 2024

@harshdoesdev can we write some test to ensure bots are getting ssr, and non bots are not?

@harshdoesdev
Copy link
Contributor Author

@harshdoesdev can we write some test to ensure bots are getting ssr, and non bots are not?

@amitu I attempted to create a test case for this using fbt, but it resulted in a stack overflow error when using fastn serve. Therefore, for the time being, can we incorporate this test directly into the workflow and write a shell or Python script for it?

@amitu amitu merged commit 3e6defc into main Feb 5, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants