TYPO3 .gzip compression and your web server

Let us start by talking about the different methods you can use to optimize your website traffic.



Do you want to combine multiple files? Then this one is for you! Concatenation will combine multiple files like JavaScript for you.


How to use it?

TYPO3 allows you to configure this per-file basis.



Want to reduce the size of your file content? Well, minification will take your files and reduce the size by removing white spaces, comments and other non mandatory parts of your file. If you want your files even smaller, you can use a mangler to replace your variable and method names with a shorter version.


How to use it?

This one needs an in-depth look. The current versions of TYPO3, 6.2 and upwards, do minification for CSS only. JavaScript is not minified by default.

For JavaScript, you would normally generate the minified and mangled version with tools like terser.



At the end of the previous mentions, methods come into compression. This will compress your file to a smaller size by trying to find common patterns and other recurring occurrences and reduce them in size.


How to use it?

This one is tricky. Normally you would enable this in TYPO3 using the compression level and config. Using this however you need to configure your web server or even your additional proxy to add encoding headers to your HTTP response.

Another common way would be to let your webserver do the job. Webservers like Apache and Nginx support modules that allow you to just do this.