# Reducing Connect time for static files

**URL:** <https://www.ruby-forum.com/t/reducing-connect-time-for-static-files/213745>\
**Category:** NGINX\
**Created:** [November 10, 2011, 12:13pm UTC](https://www.ruby-forum.com/t/reducing-connect-time-for-static-files/213745 "2011-11-10T12:13:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [November 10, 2011, 12:13pm UTC](https://www.ruby-forum.com/t/reducing-connect-time-for-static-files/213745/1 "2011-11-10T12:13:39Z")

</div>

Exploring the webpage load by pingdom service, I just found that the  
main delay of page load is due to slow load of images. The images come  
from a cookieless domain. I changed the nginx conf for that domain as

location ~\*  
^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|wma|wmv)$  
{

proxy\_redirect off;  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Real-IP $remote\_addr;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
client\_max\_body\_size 10m;  
client\_body\_buffer\_size 128k;  
proxy\_connect\_timeout 90;  
proxy\_send\_timeout 90;  
proxy\_read\_timeout 90;  
proxy\_buffer\_size 4k;  
proxy\_buffers 4 32k;  
proxy\_busy\_buffers\_size 64k;  
proxy\_temp\_file\_write\_size 64k;  
access\_log off;  
}

It did speed up the load of images a lot; but still, the load of images  
is not fast enough

Connect: 100 ms  
Send: 1 ms  
Wait 200 ms  
Receive: 100 ms

Receive is controlled by the data transfer, but I believe it is possible  
to reduce the length of connect and wait time by nginx configuration.  
Any idea?

Posted at Nginx Forum:

> **[Reducing Connect time for static files](https://forum.nginx.org/read.php?2,218159,218159#msg-218159)**
>
> Exploring the webpage load by pingdom service, I just found that the main delay of page load is due to slow load of images. The images come from a cookieless domain. I changed the nginx conf for that domain as location ~\*...
