free geoip Community Server -- Turn Off ViewState! - protected virtual void jaysonBlog
in

jaysonKnight.com

Welcome to my corner of the internet

protected virtual void jaysonBlog

A conduit to the voices in my head

Community Server -- Turn Off ViewState!

I have no idea why I didn’t catch this sooner; ASP.NET ViewState is enabled by default (and globally at that) in Community Server…I recommend that you disable it immediately if you’re running CS; there is no reliance on it whatsoever (from what I can tell by going through the source code), and all it does it lend itself to horrendous page bloat:  My main feed page was ~250k before disabling it…it’s half that size now. 

ViewState is one of those ASP.NET “features” (along with smart navigation) that sounds really good in theory, but unless you’re going to explicitly use it in your pages, it’s better just to not even worry about it.  At the very least, disable it globally and enable it on a page by page basis where you see fit.

(For any ASP.NET newbies out there) — To disable it in CS, find the <pages /> element in web.config and add the following attribute to it:  enableViewState=“false”.  I can’t believe the guys over at Telligent didn’t tune CS for this setting; it’s on page 3 of the ASP.NET performance tuning manual (the one in my head at least).  It’s also worth mentioning that CS doesn’t appear to use session state at all either (from grepping the source for ‘session’), yet it’s not explicitly disabled in web.config (glad they carried that over from .Text, session can be evil (if abused, which it usually is)).  I’ll do some testing to see if explicitly disabling it breaks anything and will post about it soon as this could also improve CS performance.

Note:  The above only applies to the blogs/galleries portions of Community Server.  It may not affect the forums piece, but I haven’t tested it so I have no idea.

Share this post: Submit Community+Server+--+Turn+Off+ViewState! to Technorati | Submit Community+Server+--+Turn+Off+ViewState! to del.icio.us | Submit Community+Server+--+Turn+Off+ViewState! to digg.com | Submit Community+Server+--+Turn+Off+ViewState! to reddit.com | Submit Community+Server+--+Turn+Off+ViewState! to DotNetKicks | Add Community+Server+--+Turn+Off+ViewState! to Live Bookmarks

Leave a Comment

(required)  
(optional)
(required)  
Add

About Jayson Knight

Jayson Knight was clueless to the computer programming world until he took a C++ class in college. The rest is proverbial history. He has been building applications targeting the .Net framework for 7 years, focusing mainly on internet technologies and database driven web application development.

Most recently he left the world of Corporate IT to finish up his degree in Chemistry, with an eye on Medical School and an Anesthesiology residency program. Read this post for more information.

He is also a Community Server MVP: Community Server is the software that runs this site, plus many others on the web. For more information, check out http://csmvps.com.

When he finds time to pry himself away from his computer and university studies, he can be found on the mountain bike trails when it's warm, and on the ski slopes when it's cold.

Copyright © :: JaysonKnight.com
External Content © :: Respective Authors

Terms of Service/Privacy Policy