function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Wayne Solomon 2016Wayne Solomon 2016 

Visualforce: Is a 60KB viewstate okay

Hi Everyone

I just want to find out some thoughts.  Is a 60KB viewstate okay for a visulaforce page.  I have 6 apex:tabs and when the page is fully loaded with data I get a viewstate up to 60KB.

Should I fdesparately find ways to decrease this or could I continue with a phase 1 rollout?

Thanks and appreciate your input.

Wayne
sandeep madhavsandeep madhav
HI,

Hope this helps,

Salesforce allows Visualforce pages to have a maximum view state size of 135KB.
The View State tab shows you which elements on your page are taking up that space.
A smaller view state size generally means quicker load times.
In order to avoid this error, minimize your pages' view state. You can optimize your Apex controller code and remove any superfluous Visualforce components used.
For example:
If you notice that a large percentage of your view state comes from objects used in controllers or controller extensions,consider refining your SOQL calls to return only data that's relevant to the Visualforce page.
If your view state is affected by a large component tree, try reducing the number of components your page depends on.