læste lige
http://stackoverflow.com/questions/3641197/how-to-specify-vary-accept-encoding-header-in-htaccess igen
du skal også have dette på
<IfModule mod_deflate.c>
#The following line is enough for .js and .css
AddOutputFilter DEFLATE js css
#The following line also enables compression by file content type, for the following list of Content-Type:s
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml
#The following lines are to avoid bugs with some browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
så ialt
# http://stackoverflow.com/questions/3641197/how-to-specify-vary-accept-encoding-header-in-htaccess
# https://www.maxcdn.com/blog/accept-encoding-its-vary-important/
<IfModule mod_deflate.c>
#The following line is enough for .js and .css
AddOutputFilter DEFLATE js css
#The following line also enables compression by file content type, for the following list of Content-Type:s
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml
#The following lines are to avoid bugs with some browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
<FilesMatch "\.(js|css|xml|html|gz)$">
Header append Vary: Accept-Encoding
</FilesMatch>
</IfModule>
mod_deflate kan også gøres via CPANEL
http://tecadmin.net/enable-apache-gzip-compression-mod_deflate-cpanel-account/#
den .htaccess er det bare en som skal ligge i mappen public_html
ja, helt ude i roden af dit site, den vil blive nedarvet i alle underliggende folderes, så du vil have det på alle undersider, medmindre du slår det fra på en sub folder, antager du har dette i toppen af din .httacces
RewriteOptions inheritmen du bør også overveje at minimize dine js og css filer.
yderligere sub optimering:
slå dine js filer sammen til 1, og det sammen med css, så du ikke skal kalde så mange filer.
Indlæg senest redigeret d. 19.11.2015 22:17 af Bruger #16075