2017-07-20 3 views
0

Google Page Speed ​​will mich Komprimierung für meine example.com/ ermöglichen
enter image description here ist meine Website powered by Wordpress so ist dies ein PHP-HTML-Seite
erzeugt habe ich wie so aktiviert Kompression (apache)gzip-Komprimierung für eine Wordpress Homepage

# Mod Deflate performs data compression 
<IfModule mod_deflate.c> 
<FilesMatch ".(js|css|html|php|xml|jpg|png|gif|svg)$"> 
SetOutputFilter DEFLATE 
BrowserMatch ^Mozilla/4 gzip-only-text/html 
BrowserMatch ^Mozilla/4.0[678] no-gzip 
BrowserMatch bMSIE no-gzip 
</FilesMatch> 
</IfModule> 

wie kann ich für die Hauptseite aktivieren (/)?

Antwort

0

auf Apache müssen Sie Ihre .htaccess Datei und fügen Sie die folgende

<IfModule mod_deflate.c> 
    # Compress HTML, CSS, JavaScript, Text, XML and fonts 
    AddOutputFilterByType DEFLATE application/javascript 
    AddOutputFilterByType DEFLATE application/rss+xml 
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject 
    AddOutputFilterByType DEFLATE application/x-font 
    AddOutputFilterByType DEFLATE application/x-font-opentype 
    AddOutputFilterByType DEFLATE application/x-font-otf 
    AddOutputFilterByType DEFLATE application/x-font-truetype 
    AddOutputFilterByType DEFLATE application/x-font-ttf 
    AddOutputFilterByType DEFLATE application/x-javascript 
    AddOutputFilterByType DEFLATE application/xhtml+xml 
    AddOutputFilterByType DEFLATE application/xml 
    AddOutputFilterByType DEFLATE font/opentype 
    AddOutputFilterByType DEFLATE font/otf 
    AddOutputFilterByType DEFLATE font/ttf 
    AddOutputFilterByType DEFLATE image/svg+xml 
    AddOutputFilterByType DEFLATE image/x-icon 
    AddOutputFilterByType DEFLATE text/css 
    AddOutputFilterByType DEFLATE text/html 
    AddOutputFilterByType DEFLATE text/javascript 
    AddOutputFilterByType DEFLATE text/plain 
    AddOutputFilterByType DEFLATE text/xml 

    # Remove browser bugs (only needed for really old browsers) 
    BrowserMatch ^Mozilla/4 gzip-only-text/html 
    BrowserMatch ^Mozilla/4\.0[678] no-gzip 
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html 
    Header append Vary User-Agent 
</IfModule> 

Dies ist ein detaillierteres Ansatz, um Ihre bereits eine Arbeit ändern.

Wichtiger Hinweis: Google PageSpeed ​​Insights erkennt ein Fehlen der GZIP-Komprimierung, wenn Ressourcen von Drittanbietern nicht mit gziped bereitgestellt werden. Möglicherweise sehen Sie mehr here.

+0

dies immer noch nicht mein Problem löst, will Google me „http komprimieren: // Beispiel. com/" – phper

+0

Wo befindet sich Ihr .htaccess? –

+0

Wie bereits erwähnt, funktioniert der Komprimierungsalgorithmus möglicherweise ordnungsgemäß. Google-Gedanken werden Ihnen keinen "Pass" geben, wenn Ressourcen von Drittanbietern nicht gezippt werden! –

0

Ok, gelöst, durch die Verwendung WP Super Cache und ermöglicht „Seiten komprimieren, so dass sie schneller auf die Besucher bedient sind“

Verwandte Themen