-
Notifications
You must be signed in to change notification settings - Fork 63
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: next seo poc #2619
base: main
Are you sure you want to change the base?
feat: next seo poc #2619
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
@@ -54,13 +55,13 @@ const useSearchParams = ({ | |||
}, [asPath, defaultSort]) | |||
} | |||
|
|||
function Page({ page: searchContentType, globalSections }: Props) { | |||
function Page({ page: searchContentType, globalSections, searchTerm }: Props) { |
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.
Risk: Affected versions of next are vulnerable to Acceptance of Extraneous Untrusted Data With Trusted Data / Authorization Bypass Through User-Controlled Key.
Fix: Upgrade this library to at least version 13.5.7 at faststore/yarn.lock:13689.
Reference(s): GHSA-gp8f-8m3g-qvj9, CVE-2024-46982
💬 To ignore this, reply with:
• /fp <comment>
for false positive
• /ar <comment>
for acceptable risk
• /other <comment>
for all other reasons
Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by ssc-adb055b9-fed0-4d70-a57d-eb9825b09449.
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
title={title} | ||
description={description} | ||
title={`${searchTerm}`} | ||
description={`${searchTerm}: em promoção que você procura? Na Americanas você encontra as melhores ofertas de produtos com entrega rápida. Vem!`} |
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.
dúvida, esse conteúdo aqui o merchant consegue customizar no repositorio dele sem reescrever toda a pagina?
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.
Em teoria sim, mas preciso validar. Pretendo mudar isso no código antes de mergear.
@@ -143,10 +148,16 @@ export const getStaticProps: GetStaticProps< | |||
contentType: 'search', | |||
}) | |||
|
|||
res.setHeader( | |||
'Cache-Control', | |||
'public, s-maxage=300, stale-while-revalidate=31536000' |
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.
acredito que devemos passar a adicionar tbm o stale-if-error=31536000
ou seja se tentar revalidar e der erro também servimos do stale ao inves de mostrar o erro
(Don't merge!)
What's the purpose of this pull request?
This POC is an alternative to indexing search pages using server side rendering. As the search page is dynamic and we need to set the title and description based on the search term, we chose to use server side rendering as it is the most suitable for this type of situation.
Nextjs reference:
Like SSG, Server-Side Rendering (SSR) is pre-rendered, which also makes it great for SEO. Instead of being generated at build time, as in SSG, SSR's HTML is generated at request time. This is great for when you have pages that are very dynamic.
https://nextjs.org/learn-pages-router/seo/rendering-and-ranking/rendering-strategies
How it works?
We use the getServerSideProps function instead of getStaticProps. We added a cache header to the response so that it is possible to cache the return in a CDN.
How to test it?
Click on: https://sfj-bed88fe--starter.preview.vtex.app/s?q=headphone
Check if the following tags were added in the document response: