# Web dev: Why do certain files take so long to load?

**URL:** <https://boards.straightdope.com/t/web-dev-why-do-certain-files-take-so-long-to-load/607706>\
**Category:** Factual Questions\
**Created:** [December 29, 2011, 6:34am UTC](https://boards.straightdope.com/t/web-dev-why-do-certain-files-take-so-long-to-load/607706 "2011-12-29T06:34:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cagey\_Drifter](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@Cagey\_Drifter](https://boards.straightdope.com/u/Cagey_Drifter)\
**Post date:** [December 29, 2011, 6:34am UTC](https://boards.straightdope.com/t/web-dev-why-do-certain-files-take-so-long-to-load/607706/1 "2011-12-29T06:34:22Z")

</div>

Using [this speed test](http://tools.pingdom.com/fpt/), I’m finding that one small graphic that is no bigger than any other is taking waaaaay longer to load than all the others on a website I am designing. It is about the 10th graphic that gets loaded. Is there a reason for this, and what can I do to avoid this delay?

---

<div class="post-metadata">

**Author:** ![tellyworth](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@tellyworth](https://boards.straightdope.com/u/tellyworth)\
**Post date:** [December 29, 2011, 6:42am UTC](https://boards.straightdope.com/t/web-dev-why-do-certain-files-take-so-long-to-load/607706/2 "2011-12-29T06:42:18Z")

</div>

Is the image file hosted on your server, or elsewhere?

When you say it’s no bigger, do you mean the image dimensions? Dimensions are irrelevant, it’s the file size that matters. ETA: pingdom gives you the size in bytes, which is what you need to compare.

---

<div class="post-metadata">

**Author:** ![Cagey\_Drifter](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@Cagey\_Drifter](https://boards.straightdope.com/u/Cagey_Drifter)\
**Post date:** [December 29, 2011, 7:07am UTC](https://boards.straightdope.com/t/web-dev-why-do-certain-files-take-so-long-to-load/607706/3 "2011-12-29T07:07:32Z")

</div>

Hosted on my server, and I’m talking about file size. It is a tiny file, only 6KB. I have about 8-9 other small files (also about 4-6KB) that I am also loading. Those load very quickly. The last one takes much, much longer to load, maybe 15-20 seconds.

---

<div class="post-metadata">

**Author:** ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)\
**Post date:** [December 29, 2011, 8:42am UTC](https://boards.straightdope.com/t/web-dev-why-do-certain-files-take-so-long-to-load/607706/4 "2011-12-29T08:42:17Z")

</div>

If you replace it with a different picture, does the new picture still take longer? Could it be that your server will only handle so many connections at once from the same location, and so the last image has to wait until everything else is loaded?

And have you tested this for real, using a computer outside you LAN, proving it isn’t some bug at the testing site?

---

<div class="post-metadata">

**Author:** ![scudsucker](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/scudsucker/32/14101_2.png) [@scudsucker](https://boards.straightdope.com/u/scudsucker)\
**Post date:** [December 29, 2011, 10:17am UTC](https://boards.straightdope.com/t/web-dev-why-do-certain-files-take-so-long-to-load/607706/5 "2011-12-29T10:17:37Z")

</div>

> [@](#):
>
> It is a tiny file, only 6KB. I have about 8-9 other small files (also about 4-6KB) that I am also loading.

If those other small files are also images, have you considered using [sprites](http://www.alistapart.com/articles/sprites) to further reduce HTTP requests and total file size?

---

<div class="post-metadata">

**Author:** ![Cagey\_Drifter](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@Cagey\_Drifter](https://boards.straightdope.com/u/Cagey_Drifter)\
**Post date:** [December 29, 2011, 4:28pm UTC](https://boards.straightdope.com/t/web-dev-why-do-certain-files-take-so-long-to-load/607706/6 "2011-12-29T16:28:28Z")

</div>

I’ve tested this using external sites, including the one mentioned in my initial post, so I know it’s not unique to my test site. I don’t think I can use sprites because the images are background images that expand based on monitor size, and I believe sprite dimensions need to be defined exactly, correct?

It might be that the server can’t handle the number of requests. Is this possibly due to a configuration issue? Is there a way to bump the number of concurrent requests up slightly?

---

<div class="post-metadata">

**Author:** ![Reply](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/reply/32/15952_2.png) [@Reply](https://boards.straightdope.com/u/Reply)\
**Post date:** [December 30, 2011, 1:04pm UTC](https://boards.straightdope.com/t/web-dev-why-do-certain-files-take-so-long-to-load/607706/7 "2011-12-30T13:04:11Z")

</div>

Is it a dynamic page (i.e., scripted or otherwise processing-intensive) or just a plain HTML with images?

If it’s a dynamic page, the image itself may only be a symptom, and it may be a script or server/database thing that’s causing the delay.

---

<div class="post-metadata">

**Author:** ![Reply](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/reply/32/15952_2.png) [@Reply](https://boards.straightdope.com/u/Reply)\
**Post date:** [December 30, 2011, 1:05pm UTC](https://boards.straightdope.com/t/web-dev-why-do-certain-files-take-so-long-to-load/607706/8 "2011-12-30T13:05:21Z")

</div>

And maybe try Google’s [Page Speed](https://code.google.com/speed/page-speed/) tools to see if they say anything?

---

<div class="post-metadata">

**Author:** ![fubbleskag](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@fubbleskag](https://boards.straightdope.com/u/fubbleskag)\
**Post date:** [December 30, 2011, 3:29pm UTC](https://boards.straightdope.com/t/web-dev-why-do-certain-files-take-so-long-to-load/607706/9 "2011-12-30T15:29:58Z")

</div>

is there any reason you can’t provide us the actual link?
