Para poder comprimir la web segui este tutorial [URL="http://www.vicentesabuco.com/programacion/php/2010-05-14/compresion-gzip-hosting-compartido-1and1.html"]http://www.vicentesabuco.com/programacion/php/2010-05-14/compresion-gzip-hosting-compartido-1and1.html[/URL]
Entonces no sé si para las demas optimizaciones tambien requerira hacerlo de una manera especial.
Las optimizaciones que no soy capaz de resolver son las siguientes:
- Configure entity tags (ETags)
- Add Expires headers
Os pongo el contenido de mi htaccess ya que no entiendo mucho del tema y entre prueba y prueba no sé si he dejado algo que no debia, o tengo algo repetido, pero el caso es que segun Yslow no tengo ni el add expires headers ni los etags.
Código:
# Catch 404 errors ErrorDocument 404 /404.php <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> # BEGIN Expire headers <ifModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 seconds" ExpiresByType image/x-icon "access plus 2592000 seconds" ExpiresByType image/jpeg "access plus 2592000 seconds" ExpiresByType image/png "access plus 2592000 seconds" ExpiresByType image/gif "access plus 2592000 seconds" ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds" ExpiresByType text/css "access plus 604800 seconds" ExpiresByType text/javascript "access plus 216000 seconds" ExpiresByType application/javascript "access plus 216000 seconds" ExpiresByType application/x-javascript "access plus 216000 seconds" ExpiresByType text/html "access plus 600 seconds" ExpiresByType application/xhtml+xml "access plus 600 seconds" </ifModule> # END Expire headers # BEGIN Cache-Control Headers <ifModule mod_headers.c> <filesMatch "\.(ico|jpe?g|png|gif|swf)$"> Header set Cache-Control "max-age=2592000, public" </filesMatch> <filesMatch "\.(css)$"> Header set Cache-Control "max-age=604800, public" </filesMatch> <filesMatch "\.(js)$"> Header set Cache-Control "max-age=216000, private" </filesMatch> <filesMatch "\.(x?html?|php)$"> Header set Cache-Control "max-age=600, private, must-revalidate" </filesMatch> </ifModule> # END Cache-Control Headers <IfModule mod_headers.c> <FilesMatch "\.(js|css|xml|gz)$"> Header append Vary Accept-Encoding </FilesMatch> </IfModule> # Compresion gzip AddType x-mapp-php5 .php .shtml .html .htm .js .txt .css AddHandler x-mapp-php5 .php .shtml .html .htm .js .txt .css # BEGIN Turn ETags Off <ifModule mod_headers.c> Header unset ETag </ifModule> FileETag None # END Turn ETags Off # BEGIN Remove Last-Modified Header <ifModule mod_headers.c> Header unset Last-Modified </ifModule> # END Remove Last-Modified Header