Gzip your components


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



Copy this code and paste it in your HTML
  1. ### For Apache 1 ###
  2.  
  3. mod_gzip_on Yes
  4.  
  5. mod_gzip_item_include mime ^application/x-javascript$
  6. mod_gzip_item_include mime ^application/json$
  7. mod_gzip_item_include mime ^text/.*$
  8.  
  9. mod_gzip_item_include file \.html$
  10. mod_gzip_item_include file \.php$
  11. mod_gzip_item_include file \.js$
  12. mod_gzip_item_include file \.css$
  13. mod_gzip_item_include file \.txt$
  14. mod_gzip_item_include file \.xml$
  15. mod_gzip_item_include file \.json$
  16.  
  17. Header append Vary Accept-Encoding
  18.  
  19. ### For Apache 2 ###
  20.  
  21. AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/json
  22. Header append Vary Accept-Encoding

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.