Not sure if this is the best place for this question but it’s something I’ve been really curious about. I’d like to use data only available on the client side for loading resources/assets for a website, such as device-pixel-ratio, touch support, etc.
The content on the page will not be changing, just resources like JS files, CSS files, and image files.
There are a few scripts already out there that work like this that run client-side tests and then store the data in a cookie, and then reload the page, loading resources based on data stored in the cookie.
The process works as follows:
- User comes to the site
- JS sets cookie with device features
- JS reloads current page
- Server can now access the cookie with all the feature data
- Can conditionally load resources and assets based on this data
Is this a bad practice to immediately reload the page as the user comes to it. Are there any SEO drawbacks to this method. It seems like a great technique for conditionally loading resources based on device capabilities. I’m just not sure if there are any reasons not to do this?
Many web crawlers do not use full Javascript or cookie functionality. For instance, GoogleBot does interpret all Javascript by default. Thus, all the content you are dynamically loading as a part of your cookie may not be detected by the crawler and will not be indexed as a result. This kills the SEO.
As a quote from Matt Cutts (Google’s webspam guy):
Reference: http://www.searchnewz.com/topstory/news/sn-2-20100315SEOInterviewwithMattCutts.html