Back to vBulletin 4.x Add-ons

Attachment Optimiser
Mod Version: 1.0, by Darkimmortal

vB Version: 4.0.0 Beta 5 Rating: (2 votes - 5.00 average) Installs: 17
Released: 28 Nov 2009 Last Update: Never Downloads: 113
Not Supported Uses Plugins Re-usable Code  

DEPRECATED - This is now merged with http://www.vbulletin.org/forum/showthread.php?p=1926114

vBulletin's attachment.php can cause a mini DoS on a FastCGI setup when images are set to display inline (or even with thumbnails, if you have enough of them on one page).

This mod assumes that your attachments are stored on the filesystem and are accessible via http://yourdomain.com/customattachments.

This mod also assumes that your are using nginx along with FastCGI. If you are using lighttpd etc. you will need to translate the config into something that works with lighty. If you are using Apache or a similar threaded webserver, that's your problem and this is no use to you.

What it does is turns this:

Code:
/attachment.php?attachmentid=246&stc=1&d=1213237132
Into this:

Code:
/customattachments/4/9/246.attach?.jpg
Which basically means your attached images load considerably faster and your forum lags a lot less.

To install, simply upload the attached .xml file as a plugin and add the following to your domain in nginx.conf:

Code:
location /customattachments {
	if ($request_uri ~* \.(png)) {
		add_header Content-Type image/png;
	}
	if ($request_uri ~* \.(jpg|jpeg)) {
		add_header Content-Type image/jpeg;
	}
	if ($request_uri ~* \.(gif)) {
		add_header Content-Type image/gif;
	}
}
Another mod which improves your FastCGI performance is my http://www.vbulletin.org/forum/showthread.php?p=1926114.

Download

File Type: %1$s attachment-optimiser.xml (484 Bytes, 126 downloads)


vblts.ru supports vBulletin®, 2022-2025