ASP Web application: Best practise in average web page size
772
Do you guys have some best practise advise on the output size of web pages. The smaller the better ofcourse. Im talking about non cached output. Id rather not return 1 MB pages.
It depends on your user base, and what kind of Internet connections they have. For broadband connections, the rendering time and the number of objects (and therefore HTTP requests) are likely to be more of a bottleneck than the sheer volume of data, even with keepalives. A user on a 4Mbit/sec connection can download 1MB of data in two seconds, but they are unlikely to be able to download 50 or 100 separate objects and render complex JavaScript and CSS that fast.
If your users are on slower connections, then work out the slowest connection speed you need to support and the maximum acceptable page load time, and size your pages accordingly. But do measure and monitor your page rendering times (I suggest looking at the mean, the median and the 90th percentile).
If you split your page into multiple files (JavaScript, CSS, images, etc...) with the proper use of HTML headers (Expires: for example) then the average amount loaded by a user can be much less than the total. For example, on my site total files per load is 100-200kb but the average amount loaded per page view is only 10-20% of that.
A good total page size will vary depending on the type of site you have and the content you're delivering. For me a 200kb page is large but for some this is huge and others this might be small. It is always a good idea to test/benchmark your site loading times. The FireBug extension for FireFox is handy for this.
Another option for some types of content is to use AJAX calls to load data bit by bit as needed after the initial page load.
Are you talking ASP, or ASP.NET? If it's ASP.NET, be mindful of the size of the Viewstate variable/field that gets embedded in the page. Any form post-backs from the browser have to send this hidden field with the request, and if you're not careful about how you're storing state in the page, it can get very large very quickly. You don't want to have your users uploading upwards of 256 KB every time they click a button or control on a page.
There's a nice little Firefox extension called Viewstate Size that will place this information in the status bar.
It depends on your user base, and what kind of Internet connections they have. For broadband connections, the rendering time and the number of objects (and therefore HTTP requests) are likely to be more of a bottleneck than the sheer volume of data, even with keepalives. A user on a 4Mbit/sec connection can download 1MB of data in two seconds, but they are unlikely to be able to download 50 or 100 separate objects and render complex JavaScript and CSS that fast.
If your users are on slower connections, then work out the slowest connection speed you need to support and the maximum acceptable page load time, and size your pages accordingly. But do measure and monitor your page rendering times (I suggest looking at the mean, the median and the 90th percentile).
If you split your page into multiple files (JavaScript, CSS, images, etc...) with the proper use of HTML headers (Expires: for example) then the average amount loaded by a user can be much less than the total. For example, on my site total files per load is 100-200kb but the average amount loaded per page view is only 10-20% of that.
A good total page size will vary depending on the type of site you have and the content you're delivering. For me a 200kb page is large but for some this is huge and others this might be small. It is always a good idea to test/benchmark your site loading times. The FireBug extension for FireFox is handy for this.
Another option for some types of content is to use AJAX calls to load data bit by bit as needed after the initial page load.
Are you talking ASP, or ASP.NET? If it's ASP.NET, be mindful of the size of the Viewstate variable/field that gets embedded in the page. Any form post-backs from the browser have to send this hidden field with the request, and if you're not careful about how you're storing state in the page, it can get very large very quickly. You don't want to have your users uploading upwards of 256 KB every time they click a button or control on a page.
There's a nice little Firefox extension called Viewstate Size that will place this information in the status bar.