Mobile app version of vmapp.org
Login or Join
Connie744

: Rendering different HTML contents based on screen size - good idea from SEO perspective? Is there an adverse effect of capturing screen size with JS and rendering different HTML contents via

@Connie744

Posted in: #Html #ResponsiveWebdesign #Seo #Shopify

Is there an adverse effect of capturing screen size with JS and rendering different HTML contents via AJAX based on user's screen size, mainly from SEO perspective?

I'm working on an ecommerce app where the homepage can be too lengthy for mobile device. For instance, there is a tab content which displays several tab-headers and 8 products per tab. This is good on tablet/desktop, but too lengthy on mobile, leading to poor user experience. What our company decided is to display only the tab headers on mobile, and not render any product under the tab. However, hiding all the products with all the thumbnail images via CSS seems like a waste. This led me to load the contents via AJAX based on user's screen size. The drawback is of course, when the user resizes the browser, the web app will still display the tab headers unless a full refresh is done. This is not a problem for us.

So the main question is - is it a good practice to render different HTML contents from server-side based on screen size?

Also, we prefer not to separate the website into two versions (m.example.com and example.com) because there are just few scenarios where we feel that rendering different HTML contents are required for better performance.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Connie744

1 Comments

Sorted by latest first Latest Oldest Best

 

@Angela700

is it a good practice to render different HTML contents from server-side based on screen size?...Also, we prefer not to separate the website into two versions...


No for a couple of reasons.


As closetnoc pointed out, your website will then commit an act of "cloaking" which is serving different content from one URL based on a screen size. Cloaking is bad because people who find your site in the search engine results pages don't want to click on something only to find out that they accessed something completely irrelevant to what they clicked on.
Processing speed might be slower. To make a site fast, its advisable to cache the HTML output, especially if the page requires several seconds to load when not-cached as a result of long loops (or similar) executed in a server script. If you're going after a third-party software for caching like w3 total cache, chances are there may not be an option to configure to cache based on advanced metrics such as screen size.


If you can't get away with responsive design, then I'd suggest using two versions of your site. You can even use a folder to designate versions. For example:
example.com/whatever <--desktop site example.com/mobile/whatever <--mobile site


Simply replace "whatever" with your usual URI. That way, you can have two versions running on one domain.

And as for hiding assets with CSS being a waste, why not put all your assets (including company logo) into one image (make a CSS sprite), then when each page loads, load the company logo so that you won't feel that you're unnecessarily loading extra image files since all images are then in one file.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme