The advantages of dynamic rendering for search engine optimisation

News Author


JavaScript frameworks have been rising in reputation over the previous few years, thanks in no small half to the flexibleness they provide. “JavaScript frameworks permit for fast improvement. It presents higher person expertise. It presents higher efficiency and it presents enhanced performance that conventional frameworks — non-JavaScript ones — kind of lack,” stated Nati Elimelech, tech search engine optimisation lead at Wix.

“So, it’s no shock that very giant web sites or advanced UIs with advanced logic and options often have a tendency to make use of JavaScript frameworks these days,” he added.

At SMX Subsequent, Elimelech supplied an outline of how JavaScript works for client-side, server-side and dynamic rendering, and shared insights for auditing gained from implementing JavaScript on over 200 million web sites.

Shopper-side vs. Server-side rendering

Completely different rendering strategies are appropriate for various functions. Elimelech advocated on behalf of dynamic rendering as a method to fulfill search engine bots and customers alike, however first, it’s vital to grasp how client-side and server-side rendering work.

Shopper-side rendering

When a person clicks on a hyperlink, their browser sends requests to the server that web site is hosted on. 

“After we’re speaking about JavaScript frameworks, that server responds with one thing that’s a bit completely different than what we’re used to,” Elimelech stated.

“It responds with a skeleton HTML — simply the essential HTML, however with quite a lot of JavaScript. Mainly, what it does is inform my browser to run the JavaScript itself to get all of the vital HTML,” he stated, including that the person’s browser then produces the rendered HTML (the ultimate HTML that’s used to assemble the web page the way in which that we truly see it). This course of is named client-side rendering.

A slide with a description of client-side rendering.
Picture: Natie Elimelech.

“It’s very very like assembling your personal furnishings as a result of principally the server tells the browser, ‘Hey, these are all of the items, these are the directions, assemble the web page. I belief you.’ And that signifies that the entire laborious lifting is moved to the browser as a substitute of the server,” Elimelech stated.

Shopper-side rendering could be nice for customers, however there are instances during which a shopper doesn’t execute JavaScript, which suggests it received’t get the total content material of your web page. One such instance could also be search engine crawlers; though Googlebot can now see extra of your content material than ever earlier than, there are nonetheless limitations.

Server-side rendering

For shoppers that don’t execute JavaScript, server-side rendering can be utilized.

“Server-side rendering is when all of that JavaScript is executed on the server-side. The entire assets are required on the server-side and your browser and the search engine bot don’t have to execute JavaScript to get the absolutely rendered HTML,” Elimelech defined. Because of this server-side rendering could be sooner and fewer resource-intensive for browsers.

A slide with a basic explanation of server-side rendering.
Picture: Natie Elimelech.

“Server-side rendering is like offering your visitors with an precise chair they will sit it on as a substitute of getting to assemble it,” he stated, persevering with his earlier analogy. “And, while you do server-side rendering, you principally make your HTML seen to every kind of bots, every kind of shoppers . . . It doesn’t matter what the JavaScript capabilities are, it might probably see the ultimate vital rendered HTML,” he added.

Dynamic rendering

Dynamic rendering represents “the most effective of each worlds,” Elimelech stated. Dynamic rendering means “switching between client-side rendered and pre-rendered content material for particular person brokers,” in line with Google. 

Under is a simplified diagram explaining how dynamic rendering works for various person brokers (customers and bots).

A flowchart describing dynamic rendering.
Picture: Natie Elimelech.

​​”So there’s a request to URL, however this time we test: Do we all know this person agent? Is that this a identified bot? Is it Google? Is it Bing? Is it Semrush? Is it one thing we all know of? If it’s not, we assume it’s a person after which we do client-side rendering,” Elimelech stated. 

In that case, the person’s browser runs the JavaScript to get the rendered HTML, however nonetheless advantages from the benefits of client-side rendering, which frequently features a perceived increase in velocity.

However, if the shopper is a bot, then server-side rendering is used to serve the absolutely rendered HTML. “So, it sees all the pieces that must be seen,” Elimelech stated.

This represents the “better of each worlds” as a result of web site homeowners are nonetheless in a position to serve their content material whatever the shopper’s JavaScript capabilities. And, as a result of there are two flows, web site homeowners can optimize every to raised serve customers or bots with out impacting the opposite.

However, dynamic rendering isn’t good

There are, nevertheless, problems related to dynamic rendering. “We have now two flows to keep up, two units of logics, caching, different advanced techniques; so it’s extra advanced when you might have two techniques as a substitute of 1,” Elimelech stated, noting that web site homeowners should additionally preserve an inventory of person brokers to be able to establish bots.

The pros and cons of dynamic rendering
Picture: Natie Elimelech.

Some may fear that serving search engine bots one thing completely different than what you’re displaying customers could be thought of cloaking.

“Dynamic rendering is definitely a most well-liked and beneficial answer by Google as a result of what Google cares about is that if the vital stuff is similar [between the two versions],” Elimelech stated, including that, “The ‘vital stuff’ is issues we care about as SEOs: the content material, the headings, the meta tags, inner hyperlinks, navigational hyperlinks, the robots, the title, the canonical, structured knowledge markup, content material, photos — all the pieces that has to do with how a bot would react to the web page . . . it’s vital to maintain an identical and while you maintain these an identical, particularly the content material and particularly the meta tags, Google has no concern with that.”

Potential site parity issues when using different JavaScript rendering methods
Picture: Natie Elimelech.

Because it’s vital to keep up parity between what you’re serving bots and what you’re serving customers, it’s additionally essential to audit for points which may break that parity.

To audit for potential issues, Elimelech recommends Screaming Frog or an identical device that permits you to examine two crawls. “So, what we love to do is crawl a web site as Googlebot (or one other search engine person agent) and crawl it as a person and ensure there aren’t any variations,” he stated. Evaluating the suitable parts between the 2 crawls can assist you establish potential points.

A slide with tools for auditing the javascript versions of your site.
Picture: Natie Elimelech.

Elimelech additionally talked about the next strategies to display for points:

“Bear in mind, JavaScript frameworks aren’t going wherever,” he stated. “Likelihood is you’re going to fulfill certainly one of them quickly, so that you higher be ready to deal with them.”

Watch the total SMX Subsequent presentation right here (free registration required).


New on Search Engine Land

About The Writer

George Nguyen is an editor for Search Engine Land, masking natural search, podcasting and e-commerce. His background is in journalism and content material advertising. Previous to getting into the trade, he labored as a radio character, author, podcast host and public college instructor.