enable gZip on (dv) server using .htaccess


/ Published in: Apache
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # gzip compression.
  2. <IfModule mod_deflate.c>
  3.  
  4. # html, txt, css, js, json, xml, htc:
  5. #AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
  6. #AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
  7. #AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
  8.  
  9. # OR...
  10.  
  11. AddOutputFilterByType DEFLATE text/plain
  12. AddOutputFilterByType DEFLATE text/html
  13. AddOutputFilterByType DEFLATE text/xml
  14. AddOutputFilterByType DEFLATE text/css
  15. AddOutputFilterByType DEFLATE application/xml
  16. AddOutputFilterByType DEFLATE application/xhtml+xml
  17. AddOutputFilterByType DEFLATE application/rss+xml
  18. AddOutputFilterByType DEFLATE application/javascript
  19. AddOutputFilterByType DEFLATE application/x-javascript
  20.  
  21.  
  22. # webfonts and svg:
  23. <FilesMatch "\.(ttf|otf|eot|svg)$" >
  24. SetOutputFilter DEFLATE
  25. </FilesMatch>
  26. </IfModule>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.