Recent Topics

1 Dec 06, 2012 14:10    

I use csf firewall to prevent possible dos attacks, and i had keep_alive disabled, and when user visits too many pages quickly (10-20 pages in under a minute or two), gets blocked by the firewall.

So i tried turning keep alive ON with a low timeout to see how it goes.The blocks seem to have ceased.And people claim that using keep_alive on serves a better performance and easier on the server, but i didnt really notice any changes loading time-wise.

The only thing that was different for me was; you know when you try to add an attachment, it brings up the file manager, and in file manager index i have hundreds of images, they used to load almost immeadietely, but after turning k_a on, it started to load them 2 by 2, or 3 by 3, and so i have to wait a while before the whole file manager index loads.

Some are pro some are against keep_alive depending on the situation, i want to know if you have any recommendations.I want to keep it OFF, because of the above file manager thing, i dont want to wait.OTOH, turning it ON will again cause people to get blocked.Of course i could easily increase the number of allowed connections, but i would not like that.

2 Dec 06, 2012 23:40

I personally use KeepAlive at 4 seconds.

The number of simultaneous connections when loading your thumbnails is built into the web browser, depends on the brand and version. Varies between 2 and 8.

3 Dec 07, 2012 00:30

The only thing that was different for me was; you know when you try to add an attachment, it brings up the file manager, and in file manager index i have hundreds of images, they used to load almost immeadietely, but after turning k_a on, it started to load them 2 by 2, or 3 by 3, and so i have to wait a while before the whole file manager index loads.

You just need to set up your webserver the right way.

<IfModule mod_expires.c>
ExpiresActive On

# images
 ExpiresByType image/png "access plus 6 month"
 ExpiresByType image/gif "access plus 6 month"
 ExpiresByType image/jpeg "access plus 6 month"
 ExpiresByType image/x-icon "access 1 year"

# css and javascript
ExpiresByType text/css                  "access plus 2 months"
ExpiresByType application/javascript    "access plus 2 months"
ExpiresByType text/javascript           "access plus 2 months"
</IfModule>

You should also add the Cache-Control "public" header. Google for more info.

4 Dec 07, 2012 00:34

NGINX

location ^~ /media/ {
	access_log off;
	error_log /dev/null;

	expires 60d;
	add_header Cache-Control public;
}

5 Dec 07, 2012 01:31

Well i tried 2 secs, and it was loading like 2 images per sec., so still a long wait before all loads.I am now trying sam2kb's suggestion with keep alive turned off again

@fplanque wrote:

I personally use KeepAlive at 4 seconds.
The number of simultaneous connections when loading your thumbnails is built into the web browser, depends on the brand and version. Varies between 2 and 8.

Ok i have added to my .htaccess and turned keep alive off.Lets see how it goes

@sam2kb wrote:

<IfModule mod_expires.c>
ExpiresActive On

# images
 ExpiresByType image/png "access plus 6 month"
 ExpiresByType image/gif "access plus 6 month"
 ExpiresByType image/jpeg "access plus 6 month"
 ExpiresByType image/x-icon "access 1 year"

# css and javascript
ExpiresByType text/css                  "access plus 2 months"
ExpiresByType application/javascript    "access plus 2 months"
ExpiresByType text/javascript           "access plus 2 months"
</IfModule>

You should also add the Cache-Control &quot;public&quot; header. Google for more info.


Form is loading...