I always found it annoying, having to compress files everytime I upload a new map/texture/sound to my server manually. That's why I started thinking about if it would be possible to compress files on the fly while the client is downloading it.
And yes, it's possible
I've spent some hours writing a PHP script and filed it out allot.
Requirements:
- Apache2 webserver running on the server machine where the gameserver is
- Apache2 mod_rewrite
- PHP 5
Features:
- On the fly bzip2 compression of any files (you can specify the allowed file extensions in config.inc.php)
- File caching (so already compressed files don't have to be compressed again)
- Simultanous file sending to clients (clients don't have to wait for the first client to be finished)
- Multiple server support
- Specify allowed file extensions
Installation
- Simply unzip and upload the attached directory to your webserver directory.
- Edit config.inc.php to match your needs
- Set chmod of cache to 0770 (rwxrwx---)
- Change the sv_downloadurl of your gameserver(s):
Example: sv_downloadurl
www.your-domain-or-ip.tld/bzip2_onthefly/configname
Put this line into your cfg/server.cfg file.
Enjoy
Note: Doesn't work for TF2 (and other orangebox games ?) atm.