Question: I have a ASP.Net WebForms page that has 2 drop-down lists (1 with 10 options, the other with about 600) and about 5 panels. Based on what value is selected from the drop-downs, other panels are made visible or invisible during async postback by querying a database.

My dilemma is this: The page is not fast enough on a slow connection, particularly during page load. When looking at the rendered page, the size of viewstate is large, even on initial load. Also, there is a large amount of data needing to populate the drop-downs, which could be contributing to the viewstate size.

Are there any suggestions to speed this page up?

Answer: 
Maybe load the options of the second dropdown list on-demand (e.g. using [AutoComplete of the AJAX control toolkit](http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AutoComplete/AutoComplete.aspx) or a similar control).
If the requests accept zip or deflate make your response return it.

```
var response = HttpContext.Current.Response;                

string acceptEncoding = HttpContext.Current.Request.Headers["Accept-Encoding"] ?? "";
if (acceptEncoding.Contains("gzip"))
{
    response.Filter =
        new System.IO.Compression.GZipStream(response.Filter,
            System.IO.Compression.CompressionMode.Compress);
    response.AppendHeader("Content-Encoding", "gzip");
}
else if (acceptEncoding.Contains("deflate"))
{
    response.Filter =
        new System.IO.Compression.DeflateStream(response.Filter,
            System.IO.Compression.CompressionMode.Compress);
    response.AppendHeader("Content-Encoding", "deflate");
}

```

And move your `ViewState` to the session. Override this property on the base page class.

```
protected override PageStatePersister PageStatePersister
{
    get { return new SessionPageStatePersister(this); }
}

```