-
Notifications
You must be signed in to change notification settings - Fork 277
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
[sitecore-jss-nextjs]: Improve performance for redirects #SXA-7834 #SXA-7866 #SXA-7780 #2003
[sitecore-jss-nextjs]: Improve performance for redirects #SXA-7834 #SXA-7866 #SXA-7780 #2003
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks as a good improvement! I added some comments
Of course you need to add unit tests, they are missing :)
We can jump on the call to discuss some uncertainties
packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts
Outdated
Show resolved
Hide resolved
packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts
Outdated
Show resolved
Hide resolved
packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts
Outdated
Show resolved
Hide resolved
packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts
Outdated
Show resolved
Hide resolved
f67d456
to
9879878
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I see that you removed caching mechanism, do we still need it for standard requests? Or it's enough to skip prefetch requests to get a stable performance?
- Unit tests are missing (e.g. new prefetch req case)
packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts
Outdated
Show resolved
Hide resolved
packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts
Outdated
Show resolved
Hide resolved
packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts
Outdated
Show resolved
Hide resolved
packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts
Outdated
Show resolved
Hide resolved
80be9ba
to
4aed299
Compare
4aed299
to
e52d837
Compare
e52d837
to
3fc1966
Compare
packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.test.ts
Outdated
Show resolved
Hide resolved
…s. Added a simpler solution for non-regex patterns to fix Netlify-related problems. Improved redirect performance.
3fc1966
to
a6fdb73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Description / Motivation
A condition for prefetch requests has been added to improve the performance of redirects.
Additionally, a condition has been added to handle Netlify requests to reduce server load.
Testing Details
Types of changes