Poprawne reguly GZIP w .htaccess.

0

Witam,

Czy jest ktos w posiadaniu dobrego toturialu, manuala do regul GZIP, kompresji stron? Musze napisac takowe i umiescic w .htaccess.

0

Wg mnie idealna będzie oficjalna dokumentacja Twojego serwera http. http://httpd.apache.org/docs/current/mod/mod_deflate.html

0

@axelbest No i ma to sens.

<IfModule mod_headers.c>
    # Serve gzip compressed CSS files if they exist 
    # and the client accepts gzip.
    RewriteCond "%{HTTP:Accept-encoding}" "gzip"
    RewriteCond "%{REQUEST_FILENAME}\.gz" -s
    RewriteRule "^(.*)\.css" "$1\.css\.gz" [QSA]

    # Serve gzip compressed JS files if they exist 
    # and the client accepts gzip.
    RewriteCond "%{HTTP:Accept-encoding}" "gzip"
    RewriteCond "%{REQUEST_FILENAME}\.gz" -s
    RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA]


    # Serve correct content types, and prevent mod_deflate double gzip.
    RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1]
    RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1]


    <FilesMatch "(\.js\.gz|\.css\.gz)$">
      # Serve correct encoding type.
      Header append Content-Encoding gzip

      # Force proxies to cache gzipped & 
      # non-gzipped css/js files separately.
      Header append Vary Accept-Encoding
    </FilesMatch>
</IfModule>
 

Czyli w zasadzie kod w podobie do powyzszego, powinien spelaniac swoja funkcje?

Jakie inne reguly w .htaccess znacie to kompresji czy optymalizacji stron www?

0

Ja swego czasu korzystałem z dodatku do chrome'a YSlow - oraz stronek z walidacjami różnych elementów jak np gtmetrix.com (ostatnio coraz trudniej się wbić na test, bo kolejki są).

1 użytkowników online, w tym zalogowanych: 0, gości: 1