You can clone with
Cannot retrieve contributors at this time
== link:index.html[Index] -> link:modules.html[Modules]Modules: Encoders------------------Encoders are Cherokee modules that can be used as filters. The mostcommon usage is to compress information allowing you to savebandwidth. You should do that whenever you can since hardware ismostly inexpensive while bandwidth is not. Besides, the performancepenalization suffered due to the compression process is trivial.Of course it doesn't make sense to apply a processor intensive filterto content that can't take advantage of it (i.e., it doesn't makesense to try to compress an already compressed file because there isnothing to gain).The encoders must be enabled or disabled in a per rule basis. Theacceptable settings for an encoder are 'Leave unset', 'Allow' and'Forbid'.This is the list of currently provided encoders:. link:modules_encoders_gzip.html[gzip]. link:modules_encoders_deflate.html[deflate]As you might have guessed from the list of acceptable settings, it isinteresting to highlight that Cherokee supports negative encodingrules. This translates into rules that forbid an encoder to beused. To prevent encoding files that are already compressed, a prettysimple rule such as the following one could be included to avoid theproblem.[options="header"]|===================================================================|Match | Final/Non-Final | Encoder setting|Extensions (jpg,zip,gz,rar,7z) | Non-Final | Gzip forbidden|====================================================================For a more complex example, imagine the following scenario:[options="header"]|===================================================================|Match | Final/Non-Final | Encoder setting| *.php | Non-Final | Gzip forbidden|a* | Non-Final | Gzip leave unset|Default | Final | Gzip allowed|====================================================================The rule list is evaluated from top to bottom. The 'Leave unset'option of the encoders means that, whenever a rule is applied, it willnot change the status of the encoding setting.Under these conditions, the following requests would be evaluated as shown:- /foo.php - wouldn't use Gzip- /aaa.txt - would use Gzip (a* wouldn't set it, but since it's non-final the default rule would)- /zzz.txt - would use it (set by the default rule)- /abc.php - it matches the first rule, so Gzip is forbidden, and since it is no-final the evaluation continues. It also matches the second rule, but since Gzip support got already forbidden nothing is changed. When it hits the last rule, the same thing happens: Gzip is already forbidden, so the value is not overwritten.