Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have some large controls that are swelling my ViewState to 10KB+. Ignoring the discussion about using alternatives to ViewState, I'm trying to minimize any impact my ViewState might have on SEO. Here's what my research has lead me to believe:

  • A lot of developers like to move ViewState to the bottom of the page by overriding Page.Render. At first glance, this works great but some people experience problems when their site is under load, or if a user gets an itchy trigger finger and submits a form before the page is done rendering (before the ViewState is in place). There are enough question marks here that I want to avoid this technique.

  • You can check if the UserAgent is a crawler (through various methods) and simply disable ViewState when you're not dealing with a real user. This also appears to do the trick (and in 3 lines of code), but some people are concerned that this is cloaking, and could actually do more harm than good to your SEO. While the intent in this case is obviously not cloaking, the result does render out significantly less KB to crawlers than to actual users and I can see the potential for automated red flags.

I'm not satisfied with either scenario, and I'm not able to find anything more on the topic. My potential solution is to combine the techniques by moving the ViewState to the bottom of the page only when the UserAgent is a crawler.

  • The crawler doesn't use the ViewState anyway, so the potential pitfalls of moving the ViewState to the bottom don't apply.

  • The same content gets delivered to crawlers and real users, albeit in a different order.

  • The crawler sees all my juicy keywords right there in the first few KB of the page.

I was hoping that I could get some feedback on this technique, especially the following:

  • Could this still be considered cloaking?

  • Are there any potential issues with this approach?

  • Am I overthinking it? Is there an easier approach that I wasn't able to find through Google?

share|improve this question

2 Answers 2

Hiding ViewState is unlikely to be seen as cloaking, as ViewState wouldn't be seen as content.

What exactly are your concerns with ViewState? If you are worried about the page speed then "cloaking" will not help you anyway. PageSpeed is measured by real visitors to your site who have the Google Toolbar.

So my suggestion would be either to get rid of ViewState entirely, or simply not worry about it and work on other issues like HTTP requests, making sure everything is gzipped, and cutting down on image size.

share|improve this answer
    
It's just 10KB+ of data above the actual content of my site. I'm concerned that my actual content will be weighted lower by being 'further' down the page. Google PROBABLY takes viewstate into account, but there's no way to know for sure. –  Steve May 26 '13 at 20:59
    
That should not be an issue either. Like I said, ViewState would not be seen as content (IIRC it's a meta tag or at least, just an attribute value on some other tag) so your content is still the first thing Googlebot sees and it not "pushed down". –  DisgruntledGoat May 27 '13 at 14:39
    
ViewState is a hidden input field. I definitely agree with you - but I can't find anywhere that Google explicitly says it will ignore the values of hidden fields. And there's quite a few websites out there detailing how to move your ViewState to the bottom of the page, so at least some people are concerned about the potential impact. So, I figure moving it to the bottom of the page for crawlers can't hurt. Thank you for the discussion! –  Steve May 27 '13 at 19:02

I wasn't familiar with what "ViewState" is. It appears to be form data used by ASP.net to save user submitted data after a form is submitted in the case that there is an error message so that the form can be re-displayed without the user losing their data.

Since you don't need ViewState until after a form is submitted, I'd recommend not displaying it at all to any user agent until after a form is submitted. That way crawlers generally will never see it and users won't get it until they need it.

share|improve this answer
    
I'm fairly sure asp.net requires ViewState to be present before you submit any form. –  DisgruntledGoat May 27 '13 at 14:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.