I got some really great comments on my last post. Apperantly FireFox doesn't report on the wire numbers, so here are the numbers from Fiddler.
After clearing the cache, a page with a text box, ScriptManager and CalendarExtender:
Request Count: 17
Bytes Sent: 10,492
Bytes Received: 149,145
Refreshing the page (meaning we get stuff from the cache):
Request Count: 14
Bytes Sent: 9,382
Bytes Received: 31,932
That is still 31Kb that I am not sure where they are coming from. Based on the feedback from the last post, it looks like there are a few other things that need to be done.
- Get AjaxToolKit that is compiled in release mode.
- <compilation debug="false">
-
<
scriptResourceHandler enableCompression="true" enableCaching="true" />
After clearing the cache, same page:
Request Count: 14
Bytes Sent: 9,282
Bytes Received: 122,254
Refresh the page (get stuff from cache):
Request Count: 14
Bytes Sent: 9,382
Bytes Received: 32,010
So, we still get 31Kb, but worse than that, we get 14 requests(!).
Same page, without CalendarExtender (no cache):
Request Count: 5
Bytes Sent: 2,806
Bytes Received: 56,702
With cache:
Request Count: 4
Bytes Sent: 2,482
Bytes Received: 23,873
The request that seems to be biggest (and apperntly uncached) is: /WebResource.axd?d=vreWgJm8KHsCnZnd2dT3Zg2&t=633067941986250000 and it contains javascript functions such as WebForm_PostBackOptions and friends.
For comparision purposes, I have removed the ScriptManager as well:
Request Count: 2
Bytes Sent: 978
Bytes Received: 2,540
And when it is cached:
Request Count: 1
Bytes Sent: 554
Bytes Received: 747
As far as I can tell, I am doing everything the way I should do it. But this also means that the issue is with the weight, but the request count. HTTP allows only 2 requests per host, and that means that in cases where just the scripts takes 14 requests, everything else that is Ajaxified will need to wait for them to complete.
The solution for me was to drop the CalendarExtender completely, I went with a simple javascript calendar, it doesn't do sliding animations and other cool stuff that the CalendarExtender does, but it doesn't kill my site when it is working, either.