Advertisement
Guest User

Untitled

a guest
Apr 14th, 2016
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1. # Force the latest IE version, in various cases when it may fall back to IE7 mode
  2. # github.com/rails/rails/commit/123eb25#commitcomment-118920
  3. # Use ChromeFrame if it's installed for a better experience for the poor IE folk
  4. <IfModule mod_setenvif.c>
  5. <IfModule mod_headers.c>
  6. BrowserMatch MSIE ie
  7. Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
  8. </IfModule>
  9. </IfModule>
  10.  
  11. <IfModule mod_headers.c>
  12. #
  13. # Because X-UA-Compatible isn't sent to non-IE (to save header bytes),
  14. # We need to inform proxies that content changes based on UA
  15. #
  16. Header append Vary User-Agent
  17. # Cache control is set only if mod_headers is enabled, so that's unncessary to declare
  18. </IfModule>
  19.  
  20. # gzip compression.
  21. <IfModule mod_deflate.c>
  22.  
  23. # html, txt, css, js, json, xml, htc:
  24. AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
  25. AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
  26. AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
  27.  
  28. # webfonts and svg:
  29. <FilesMatch "\.(ttf|otf|eot|svg)$" >
  30. SetOutputFilter DEFLATE
  31. </FilesMatch>
  32. </IfModule>
  33. <IfModule mod_expires.c>
  34. Header set Cache-Control "public"
  35. ExpiresActive on
  36.  
  37. # Perhaps better to whitelist expires rules? Perhaps.
  38. ExpiresDefault "access plus 1 month"
  39.  
  40. # cache.manifest needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
  41. ExpiresByType text/cache-manifest "access plus 0 seconds"
  42.  
  43. # your document html
  44. ExpiresByType text/html "access plus 0 seconds"
  45.  
  46. # data
  47. ExpiresByType text/xml "access plus 0 seconds"
  48. ExpiresByType application/xml "access plus 0 seconds"
  49. ExpiresByType application/json "access plus 0 seconds"
  50.  
  51.  
  52. # rss feed
  53. ExpiresByType application/rss+xml "access plus 1 hour"
  54.  
  55. # favicon (cannot be renamed)
  56. ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
  57.  
  58. # media: images, video, audio
  59. ExpiresByType image/gif "access plus 1 month"
  60. ExpiresByType image/png "access plus 1 month"
  61. ExpiresByType image/jpg "access plus 1 month"
  62. ExpiresByType image/jpeg "access plus 1 month"
  63. ExpiresByType video/ogg "access plus 1 month"
  64. ExpiresByType audio/ogg "access plus 1 month"
  65. ExpiresByType video/mp4 "access plus 1 month"
  66. ExpiresByType video/webm "access plus 1 month"
  67.  
  68. # webfonts
  69. ExpiresByType font/truetype "access plus 1 month"
  70. ExpiresByType font/opentype "access plus 1 month"
  71. ExpiresByType font/woff "access plus 1 month"
  72. ExpiresByType image/svg+xml "access plus 1 month"
  73. ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
  74.  
  75. # css and javascript
  76. ExpiresByType text/css "access plus 1 month"
  77. ExpiresByType application/javascript "access plus 1 month"
  78. ExpiresByType text/javascript "access plus 1 month"
  79. </IfModule>
  80.  
  81. #
  82. Options -MultiViews
  83. Options -Indexes
  84.  
  85. # use utf-8 encoding for anything served text/plain or text/html
  86. AddDefaultCharset utf-8
  87. # force utf-8 for a number of file formats
  88. AddCharset utf-8 .html .css .js .xml .json .rss
  89.  
  90. # We don't need to tell everyone we're apache.
  91. ServerSignature Off
  92. <IfModule mod_security.c>
  93. SecFilterScanPOST Off
  94. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement