Maximum size for web pages and directories


Hello Everyone:

I am currently creating a web site that consists of many HTML and JPEG files with a few CSS, GIF and PNG files.

(1) Is there a suggested maximum size in kilobytes or megabytes for a web page that will still allow the page to download quickly for most visitors?

(2) Is there a suggested maximum number of files per directory for the Debian Linux operating system on DreamHost’s computers?



It will be difficult to answer this question. Generally the smaller the size, the better downloading speed.

There are some free website optimization tips. You may want to take a look. This is only one of the sites. I’m sure you can google a lot of them.

By default, there is limit for maximum number of files per directory when we format a partition in Linux. But I’m not sure how DH does that. Probably we can submit a ticket and check with DH support.

I doubt there should be no limit. Or it gonna be a problem for a shared server.

$50 off and 3 free domains with code: [color=#CC0000]DH3[/color] Sign Up NOW or More Codes Here


It is worth noting that in this broadband world we live in, the time it takes to download the HTML portion of a web page is almost irrelevant, because it in all but the largest files (with lots of scrollbar action) it takes just as long for the browser to render the page as it does to download it. This is particularly true if the page has lots of nested tables, or a rather complicated float layout, or a lot of images to flow the text around.

So download time isn’t as important as how-long-it-takes-before-the-user-sees-anything time. Lots of images on a page, for example, means lots of HTTP requests. Browsers will usually try to make multiple connections to grab resources like images (the specified limit in HTTP is 5, but many browsers exceed this) but even so, each connection will be subject to the usually issues of availability and latency.

For improved performance, consider using only external CSS documents. Avoid having too many of these because of the HTTP connection issue. Likewise with JavaScript. External CSS and JavaScript files will most likely be cached, which means a user will spend less time waiting after they are first loaded. Keep the number of images on a page down to a minimum, and use smaller versions of images instead of forcing the browser to shrink larger images. If using JPEGs, experiment with compression - you’ll be surprised how much you can get away with. Shrink PNGs with PNG Crush or similar applications.

More on this sort of thing on this DreamHost Wiki page.

Max discount on any plan with promocode SCJESSEYTOTAL


Besides what everyone else is suggesting, which is all great. I’d like to suggest that you debug and optimize using Firefox, Firebug and YSlow.

Use the [color=#CC0000]3DOM50[/color] promo code for 3 extra lifetime domains and $50 off
More Dreamhost coupons here!


Hello Everyone;

Thank you for your responses to my questions. I have checked out the links to websites that you have pointed me to.

After too many years of teaching in rural communities with old computers and dial-up internet connections I do not think my problem is learning how to optimize my website by making the files smaller and quicker to download. Instead my difficult is not knowing my limits now that I am using a new computer and finally have access to much faster internet connection speeds.

In hindsight, in looking at the work I have done on my new website I am realizing that I have probably created far too many directories with only a few files in some of them. In the future, when adding new sections to my website I am thinking that I should try to create fewer directories with more files per directory. I asked question #2 up above because I want to know if there is any sort of maximum number of files per directory that I should be aware of.

I asked question #1 up above mainly because I am not sure how many pictures to include on a page of thumbnails. I have always considered tiny little thumbnails to be useless so my thumbnails tend to be small pictures of 226 x 150 pixels or 300 x 200 pixels. I suspect that many of the visitors to my website will be satisfied just seeing these small pictures and only the most curious will want to proceed to see the full size photo.

In one section of my website I took 40 thumbnails of 300 x 200 pixels and divided them into 5 pages of 7 to 10 thumbnails per page. When watching a relative visit my website I realized that she was getting frustrated with having to find and click on the link to the next page so frequently. In another section of my website I tried taking 27 thumbnails of 226 x 150 pixels and displayed them on a single page. I thought that I was pushing the maximum limits of kilobytes per page until I started wandering around the internet and realized that my page would download and display faster than some of the websites that I visited.

I am currently creating a new section for my website that will have approximately 100 thumbnails of 300 x 200 pixels. I am wondering how many thumbnails I should include on a page. I would like to find the optimum balance between pages that will download and display relatively quickly versus not asking my visitors to find and click on the next page link too often.

I am not sure if it would help but my website is:
The sections of my website that I have referred to are Photographs of Split Lake (40 thumbnail pictures) and Science Experiment: Dissecting a Bird (27 thumbnail pictures).

I would appreciate any advice and suggestions you may have.



You would have to be doing something really crazy to run into any kind of problem with this. Something like running an automated script that creates thousands of files occasionally for no apparent reason, or trying to duplicate an upload service like ImageShack, or things of that nature. Given that your site seems to be completely not any of those things, there’s no reason for you to be worried about running into some sort of limit.

Why not let the users decide? :slight_smile:

Often times, sites do some scripting to allow users to choose between either an arbitrary page size or, more commonly, a small number of preset page sizes. You could make the default be, say, 10 thumbs per page, but include options for 25, 50, 100, or whatever, so that users can decide for themselves how to make the tradeoff between clicking “next” a bunch of times or waiting a while for a single page to load with everything.


I have just checked the small sections on scripting in my HTML reference textbook and cannot determine what type of scripting I would have to learn about to accomplish what you suggest. Is this something that could be done using JavaScript or some other form of scripting?



I’ve got hundreds of directories on my main site, and most of my files are called “index.php” (or something similar). I typically have no more than 3 or files in each directory, and usually only one. There is no problem with having a low file to directory ratio.

Max discount on any plan with promocode SCJESSEYTOTAL


Not sure I understand exactly what the problem is but if you want to keep users on the same page you could try some of the tricks demonstrated by Stu Nicholls at - look at link below or try some of the other variations listed on homepage.

Much as I admire the work I am unlikely to ever provide similar pages to the public because a lot of my users are still on dial-ups, and I suspect mobile devices with bandwidth and screen limitations are going to be increasingly important in the future.