I am new to websites compression and the ways used to do so. I want to know how to compress all page content and sources such as css, JS, images and so on. I know this could be a big topic, but the start always begin with simple questions and answers.
Do I have to compress things in specific format or there is a way how to do that?
Update #1
I tested some of my web pages on the optimizer site to see how things go, but it turned out that I need a lot of content compression. so now what is the right way to do the compression on Apache?
If you mean serving compressed content, then the standard is supporting
deflateandgzip.It is advisable to turn compression on only on textual files (HTML, script output, CSS, JS), since JPG/PNG images are already compressed and it would be unnecessary overhead for your server.
In Apache, for instance, you can use
mod_deflate.It allows you to specify which file types to compress, thanks to the
AddOutputFilterByTypedirective.More info at http://httpd.apache.org/docs/2.0/mod/mod_deflate.html.