Skip to content

Instantly share code, notes, and snippets.

@sdeluce
Last active January 3, 2016 21:59
Show Gist options
  • Save sdeluce/8525084 to your computer and use it in GitHub Desktop.
Save sdeluce/8525084 to your computer and use it in GitHub Desktop.
htaccess gzip
## activation ZEND optimizer
SetEnv ZEND_OPTIMIZER 1
## suppression de SESSID dans les url
SetEnv SESSION_USE_TRANS_SID 0
## serveur en PHP5
SetEnv PHP_VER 5_3
## Commenter la ligne ci-dessous si plantage
# php_flag zlib.output_compression on
## Activer le filtre
SetOutputFilter DEFLATE
## Certains navigateurs ne peuvent pas avoir GZIP (les vieux)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0678 no-gzip
## On ne prend pas IE
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
## On ne compresse pas les images, elles le sont déjà
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
## on gère le cas des proxy
Header append Vary User-Agent env=!dont-vary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment