Witam. Chciałbym aby moja witryna wczytywała się szybciej. W teście YSlow v2, wykazało:
- Add expires headers (F)
- Use a content Delivery Networks (F)
- Use Cookie-Free domains (F)
Czy któreś z nich można poprawić za pomocą htaccess? Jeśli nie to jak inaczej ?
Mój htaccess:
<IfModule mod_deflate.c>
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# CSS
AddType text/css .css
# XHTML
AddType application/xhtml+xml .xhtml
# XML
AddType text/xml .xml
# XUL
AddType application/vnd.mozilla.xul+xml .xul
# Add-ons
AddType application/x-xpinstall .xpi
# SVG
AddType image/svg+xml .svg .svgz
AddEncoding x-gzip .svgz
# HTML
# Server Side Includes (SSI)
AddType text/html .shtml
# Active Server Pages
AddType text/html .asp
# Favicons
AddType image/vnd.microsoft.icon .ico
# Macromedia
AddType application/x-shockwave-flash .swf
AddType application/x-director .dir .dcr .dxr .fgd
AddType application/x-authorware-map .aam
AddType application/x-authorware-seg .aas
AddType application/x-authorware-bin .aab
AddType image/x-freehand .fh4 .fh5 .fh7 .fhc .fh
# Adobe PDF
AddType application/pdf .pdf
# Real
AddType application/vnd.rn-realmedia .rm
AddType audio/vnd.rn-realaudio .ra .ram
AddType video/vnd.rn-realvideo .rv
AddType audio/x-pn-realaudio-plugin .rpm
# Microsoft multimedia
AddType video/x-ms-asf .asf .asx
AddType audio/x-ms-wma .wma
AddType audio/x-ms-wax .wax
AddType video/x-ms-wmv .wmv
AddType video/x-ms-wvx .wvx
AddType video/x-ms-wm .wm
AddType video/x-ms-wmx .wmx
AddType application/x-ms-wmz .wmz
AddType application/x-ms-wmd .wmd
# MPEG
AddType audio/x-mpegurl .m3u
# Binary Compressed files and archives
AddType application/zip .zip
AddType application/x-gzip .gz
AddType application/x-gtar .gtar
AddType application/x-rar-compressed .rar
AddType application/octet-stream .dmg
# Java
AddType application/x-java-applet .class
# Quicktime movies
AddType video/quicktime .mov .qt
# XBM files
AddType image/x-xbitmap .xbm
# WAV files
AddType audio/x-wav .wav
# Bittorrent
AddType application/x-bittorrent .torrent
<FilesMatch mp4>
Satisfy any
order allow,deny
allow from all
</FilesMatch>
# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|ico)$ no-gzip
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*)\.(\d+)(_m_\d+)?\.([^\.]+)$ $1.$4 [L,QSA]
</IfModule>
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)(\.gz)?$">
Header set Expires "Thu, 15 Apr 2012 20:00:00 GMT"
Header unset ETag
FileETag None
</FilesMatch>
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
Z góry pozdrawiam i dziękuje :)