You may be in a position that your connection to the Internet is slow. Internet connections speeds typically have an asymmetric split between download and upload speeds, with the download speed typically being larger/faster than the upload. If your download speed is poor, your upload speed could be even worse. In this article I’ll show you how to trim back an already small software distribution into a more lightweight option that will save you time and bytes when you’re uploading.
Take a look around the Textpattern version 4.5.7 distribution as it’s released. According to my computer here it’s 2332KB, or 2.3M. I’m using the UNIX `du` command to find that out:
$ du -sk ./textpattern-4.5.7/ 2332 ./textpattern-4.5.7/
Now, the aim of this exercise is to strip that back to a smaller size without compromising any functionality that’s important to you. An easy win is to remove the `rpc` directory if you’re not using it. RPC is a way of remotely connecting to your Textpattern instance from, say, a desktop client. I have never seen anyone use RPC, and it’s turned off by default, so unless you’re specifically using it you can delete that directory from the new files.
Next, you will already have the `files` and `images` directories on your live server, so you can delete those from the new files. Make sure you delete the new `files` and `images` directories and not those on your live server (you have backups, right?). `README.txt` and `HISTORY.txt` can also be deleted. Navigate into the `textpattern` directory and locate the `setup` directory. If you’re upgrading, you don’t need this directory at all, so you can delete it. You can also zap `textpattern/lgpl-2.1.txt` and `textpattern/license.txt`. Let’s see how the revised file and directory tree sizes up after this paring back:
$ du -sk ./textpattern-4.5.7/ 1836 ./textpattern-4.5.7/
Not bad. That’s taken it down to 1836KB, which is a reduction of more than 20%. It’s possible to eke a bit more out, but there’re going to be diminishing returns from here. If you’re using an admin theme that you’re happy with, you can delete the others from the distribution. I use the Classic theme, so I can safely delete Hive and Remora from `textpattern/theme/hive` and `textpattern/theme/remora` respectively. Running `du` again shows another notable reduction in size:
$ du -sk ./textpattern-4.5.7/ 1512 ./textpattern-4.5.7/
Nice. That’s 1.5M, which is about 35% less size-wise than the original distribution, and still maintains most of the core product features for the majority of normal use case scenarios. Now you can follow the Textpattern version 4.5.7 upgrade instructions in my previous article and get your Textpattern instance(s) up-to-date.