DEV Community

Matheus Luz
Matheus Luz

Posted on

Is Preact SEO friendly?

I've been searching for this, but I can't find a definitive answer anywhere. Some posts seens to hint that preact can be good for SEO, but does it need to use SSR for it?

How dev.to handles good SEO pages using preact?

Considering that SSR is the answer, Does it need to have SSR in every page?

Oldest comments (6)

Collapse
 
benbot profile image
Benjamin Botwin • Edited

For Your site to take advantage of SEO techniques your pages would have to be server side rendered. This is because webcrawlers wont execute all of the arbitrary JS on your pages, so they rely on those pre-rendered pages to learn about your site and rank it accordingly. This is true for any non static site, regardless of the framework being used.

Every page doesn’t need SSR, however. Usually only your public pages, that is, pages that are accessible without being logged in or anything like that, need to be crawled and thus need to be server side rendered.

Collapse
 
mt3o profile image
mt3o

For some time, Google says they don't require SSR to crawl the site. What your saying is in general true, but it's false for Google.

Collapse
 
benbot profile image
Benjamin Botwin

Oh wow, I didn’t know that.
Still I’d say it’s good practice to SSR pages that you want to be crawled. Not every uses (or can use) Google

Thread Thread
 
mt3o profile image
mt3o

Whether or not they can use Google, it's a separate topic. That fraction of users in China - I'd say you can ignore them, unless you are targeting just the Chinese market. However the other way around relationship remains true, even if you target Chinese market, pay attention to Google because they set the standards.
Today even legacy enterprise search engines like IDOL crawl js-heavy websites by changing few switches in the connector.

Regarding SSR, it gives more benefits to the user, not the search engine, as the user can get the contents faster, in 1 request, not multiple (one to get html, another to get js, and another to get the data).

Collapse
 
cadams profile image
Chad Adams • Edited

Is there a reason you need to use Preact? The solution is really easy. If you want SSR you use next.js if you are building a static site (no server) use Gatsby.js. My personal website uses Gatsby and you can use google lighthouse to measure your SEO score.

Collapse
 
pankajpatel profile image
Pankaj Patel • Edited

In my opinion, SSR is needed on all points where you need the page to be Crawled by Search Engines.

Earlier it used to be achieved by adding the HTML snapshot of the page route; now it is done with SSR

It is true that Google Crawler can execute JS, though it does not mean that we put all the content in AJAX requests, as it will slow down the crawling of the site itself.

There should be a mix of SSR and AJAX loaded content.

So if preact can be used in SSR, it is SEO friendly, just like other libs and frameworks.