The mod_deflate module provides the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network.
See also Apache 2.2 documentation.
This directive will compress all content except images per default.
# gzip files to improve performance with mod_deflate <IfModule mod_deflate.c> # Compress everything except images <Location /> # Insert filter SetOutputFilter DEFLATE # Netscape 4.x has some problems... BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0 no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # Don't compress images and zip files SetEnvIfNoCase Request_URI \ \.(?:gif|jpe?g|png|zip)$ no-gzip dont-vary # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary </Location> </IfModule>
This module controls the setting of the Expires HTTP header and the max-age directive of the Cache-Control HTTP header in server responses. The expiration date can set to be relative to either the time the source file was last modified, or to the time of the client access.
These HTTP headers are an instruction to the client about the document's validity and persistence. If cached, the document may be fetched from the cache rather than from the source until this time has passed. After that, the cache copy is considered “expired” and invalid, and a new copy must be obtained from the source.
See also Apache 2.2 documentation
Just add the following snippet in to your httpd.conf:
# enable expirations with mod_expires <IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 2 weeks" </IfModule>
Set the following in your Apache httpd.conf:
# deactivate ETags FileETag None
ps -ylC httpd --sort:rss