Let me try explaining some aspects of RadCompression options and features:
- When you enable the RadCompression module (through the web.config httpModules section), you actually get the entire response compressed (including the ViewState). Note that RadCompression will automatically detect and compress requests that expect these content response types (as found in the HTTP request's "ContentType" header or "AcceptsTypes" header):
In case postback compression is also enabled, the same compression process (the entire response including the viewstate) takes place in every postback as well.
Based on the above, you do not need to enable ViewState compression through a browser file. The viewstate is already compressed as part of the entire response compression.
- RadCompression allows compression for the viewstate only (the rest of the response stays intact). This can be achieved by adding the RadHiddenFieldPageStateCompression adapter in a browser file as you have already discovered. Note that this adapter is an overriden version of RadCompression (inherits from RadCompression) that compresses just the viewstate. Therefore to use the adapter you do not need to enable RadCompression module through the web config file as described above. RadHiddenFieldPageStateCompression is designed to be used separately from the RadCompression module in cases where only viewstate compression is needed.
- Determining the viewstate size on the client may mislead you. What you actually see is the decompressed viewstate because the browser automatically decompresses it behind the scenes after the response is received. To verify that the compression works correctly, you should examine the response size instead of the viewstate size.
As to your particular scenario - since you have enabled RadHiddenFieldPageStateCompression as well as RadCompression, you actually get the viewstate compressed twice in some of the requests. As described above you should use only one of those features. Judging by the enabled postback compression, I suggest that you use the RadCompression module only and remove the RadHiddenFieldPageStateCompression adapter from the browser file. This way the entire response (including the viewstate) will be correctly compressed only once.
I hope this helps.
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed