Apache mod_ext_filter

Article named Vzduch v kódu (HTML a CSS) talks about post-production compression of HTML code and CSS using a special software, after you have all your code ready to be published.

More elegant way (at least for me) to do this is the server-side compression (whitespace stripping) on-the-fly, which can be for example done by a small (but experimental) module called mod_ext_filter for The Apache web server. This module provides very easy way to do almost any post-processing. For example post-processing of style sheets or any markup language code.

Easy way in this context means that you have to write a few lines of C/C++ code (or if you don’t speak C, you can use the shell script or anything you are familiar with) which will read the content from the standard input, strip whitespaces (and possibly all comments and other garbage) and return it to the standard output.

Module mod_ext_filter also supports cacheable output, so you don’t have to handle it in your code. And you have to never think about not forgetting to compress your new style sheets or code again. You simply publish it and forget.

Notice that advanced users should use mod_filter directly instead of using mod_ext_filter.

Napsat komentář

Vaše e-mailová adresa nebude zveřejněna.

Time limit is exhausted. Please reload CAPTCHA.

Tato stránka používá Akismet k omezení spamu. Podívejte se, jak vaše data z komentářů zpracováváme..