Using GZIP for Faster Websites
Good webmasters and system administrators are always looking for ways to increase efficiency and create faster websites. While much of website speed depends on the speed of the server, network connection, and the design of the site, there are other software tweaks that can add some zip to your site. Gzip compression is one of those tweaks.
Gzip is a free and open compression method, developed by the GNU project (the same project responsible for a good portion of GNU/Linux). Gzip is also an RFC 1952 standard and is the most popular method for web compression. What essentially happens is that the browser (client) contacts the site (host) and receives a header that indicates that the file can be compressed with gzip. If the browser supports gzip, it will respond and retrieve the compressed file, extract the contents, and display. As a result, it takes less time to download content, thus reducing stress on the server.
Gzip can reduce response size by 70%, which means a tremendous amount of savings on bandwidth. Furthermore, nearly 90% of browsers used on the Internet support it, which includes all modern browsers. The older ones that do not support it are fading away quickly. Apache 1.3 uses a module called mod_gzip, while Apache 2 uses one called mod_deflate. Many content management systems have support for gzip compression built into the backend, if the user choose to enable it.
Tag: apache, compression, gnu, gzip, http, speed, web server
How to create a compressed tar.gz archive
Compressing files is an important skill to have. You never know when you might need to move large amounts of data, and knowing how to compress them into a smaller sized single archive can save you a lot of time and disk space. Compressed files are particularly useful for backups and long-term storage of data.
Most desktop operating systems provided built-in support for zip, tar, and/or gzip files. With a graphical interface, it is easy to create compressed files, but on a server, you need to learn how to do it from the command line. The most common Linux compression format is .tar.gz, which is a tarball compressed with gzip.
To compress a directory containing files, type from the secure shell (SSH) prompt:
tar -pczf name-of-archive.tar.gz /home/user/files
You should now have a compressed archive that you can transfer easily and uncompress when you need it.
Tag: archives, compressed files, gzip, linux, tar, zip
Linux File Compression
Question: I downloaded a script that I want to install on my website, but the file extension is tar.gz. What is it, and what do I do with it?
Answer: That file extension, .tar.gz means that the file has been doubly compressed with both TAR and GZIP. These are both common Unix and Linux programs that have better compression ratios than the typical Windows ZIP files. All you need to uncompress the file is the right software.
If you are running a dedicated server, just upload the file and then run the following command:
tar -zxvf filename.tar.gz
This will extract the file’s contents and preserve any directories inside.
If you are using a shared hosting account and do not have SSH access, you will need to extract the files onto your local computer and then upload them. For Windows, you can download a free and open source application called 7-Zip, which handles tar, zip, gzip, rar, and a host of others. For Mac OS X, try GUI Tar, which is also free of charge.
Tag: gzip, linux, mac, script, server, shared hosting, ssh, tar, windows