• gernot
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Hi all,

Does anyone know a way to cut down the size of the viewstate that gets posted to and from the server?  We are finding very noticeable performance hits when we do AJAX postbacks (or any kind of postback really).  We have done some investigation and have noticed the viewstate is very large for what we are actually rendering to the browser.  For example:

<apex:page>

           <apex:form>

            </apex:form>

</apex:page>

ViewState size = 1772 bytes

<apex:page standardController="Case">

            <apex:form>

                  <table>

                        <tr><th>Head</th></tr>

                        <tr><td>Content</td></tr>

                  </table>

                  <c:TestComponent />

            </apex:form>

            <apex:outputField value="{!Case.Contact.Name}" />

            <apex:outputPanel />

            <apex:outputText value="Test" />

</apex:page>

<apex:component>

      <table>

            <tr><td>Content In Component</td></tr>

      </table>

</apex:component>

ViewState size = 3756 bytes

As you can see these are simple examples that we have slowly built out to monitor the increase in viewstate.  Naturally as our pages get more complex the viewstate gets excessively large, slowing down the round trip to the SF servers.

Therefore, the questions I have are:

Can we configure the viewstate for each component like ASP.Net allows (or for the entire page)?


Cheers