http://fr.webmaster-rank.info/news/google-page-speed-online-optimiser-la-rapidite-d-affichage-de-vos-pages-sur-le-net.html
http://code.google.com/intl/fr/speed/page-speed/docs/caching.html#LeverageBrowserCaching
# BEGIN Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"
ExpiresByType image/jpg "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"
AddType image/x-icon .ico
ExpiresByType image/ico "access plus 2592000 seconds"
ExpiresByType image/icon "access plus 2592000 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType text/css "access plus 2592000 seconds"
ExpiresByType text/javascript "access plus 2592000 seconds"
ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType application/xhtml+xml "access plus 7200 seconds"
ExpiresByType application/javascript A259200
ExpiresByType application/x-javascript "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
</IfModule>
# END Expire headers
# BEGIN Cache-Control Headers
<IfModule mod_headers.c>
<FilesMatch "\\.(ico|jpe?g|png|gif|swf|gz|ttf)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\\.(css)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\\.(js)$">
Header set Cache-Control "max-age=2592000, private"
</FilesMatch>
<filesMatch "\\.(html|htm)$">
Header set Cache-Control "max-age=7200, public"
</filesMatch>
# Disable caching for scripts and other dynamic files
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>
# END Cache-Control Headers
# KILL THEM ETAGS
Header unset ETag
FileETag none
# Compress the files
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript

MaterielMeD a écrit:Le composant FF > Firebird // Pagespeed suggère les solutions à adopter en fournissant aussi une aide technique permettant de faire les changements
referenceur a écrit:Non je ne dis pas cela Laurent au contraire
laurent59 a écrit:GTmetrix... qui lui aussi suggère les solutions

laurent59 a écrit:Hello !
Et voilà...
- Code: Tout sélectionner
# BEGIN Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"
ExpiresByType image/jpg "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"
AddType image/x-icon .ico
ExpiresByType image/ico "access plus 2592000 seconds"
ExpiresByType image/icon "access plus 2592000 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType text/css "access plus 2592000 seconds"
ExpiresByType text/javascript "access plus 2592000 seconds"
ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType application/xhtml+xml "access plus 7200 seconds"
ExpiresByType application/javascript A259200
ExpiresByType application/x-javascript "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
</IfModule>
# END Expire headers
# BEGIN Cache-Control Headers
<IfModule mod_headers.c>
<FilesMatch "\\.(ico|jpe?g|png|gif|swf|gz|ttf)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\\.(css)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\\.(js)$">
Header set Cache-Control "max-age=2592000, private"
</FilesMatch>
<filesMatch "\\.(html|htm)$">
Header set Cache-Control "max-age=7200, public"
</filesMatch>
# Disable caching for scripts and other dynamic files
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>
# END Cache-Control Headers
# KILL THEM ETAGS
Header unset ETag
FileETag none
aquatique_p.jpg (délai d'expiration non spécifié)# Mise en cache pendant 45 jours
<FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|js|css|pdf|doc)$">
Header set Cache-Control "max-age=3888000"
</FilesMatch>
etc ...Cache-Control: max-age.
http://www.unesourisetmoi.info/phpinfo.phpbg62 a écrit:ps : regarde aussi le problème sur ma "descente aux enfers" , je viens d'y mettre une réponse ...
non, c'est au niveau de ton serveur Apache qu'il faut voir et notamment le fichier httpd.conf
Cela donne quoi au niveau de ton htaccess ? Tjrs le problème de cache ?
http://www.seomix.fr/web/developpement/guide-htaccess-performances-et-temps-de-chargement/http://blog.akaconsulting.net/post/2010/03/10/Optimiser-un-site-avec-mod_expires# MOD_DEFLATE COMPRESSION
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-httpd-php
#Pour les navigateurs incompatibles
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
#ne pas mettre en cache si ces fichiers le sont déjà
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
#les proxies doivent donner le bon contenu
Header append Vary User-Agent env=!dont-vary
# BEGIN Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"
ExpiresByType image/jpg "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"
AddType image/x-icon .ico
ExpiresByType image/ico "access plus 2592000 seconds"
ExpiresByType image/icon "access plus 2592000 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType text/css "access plus 2592000 seconds"
ExpiresByType text/javascript "access plus 2592000 seconds"
ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType application/xhtml+xml "access plus 7200 seconds"
ExpiresByType application/javascript A259200
ExpiresByType application/x-javascript "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
</IfModule>
# END Expire headers
# BEGIN Cache-Control Headers
<IfModule mod_headers.c>
<FilesMatch "\\.(ico|jpe?g|png|gif|swf|gz|ttf)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\\.(css)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\\.(js)$">
Header set Cache-Control "max-age=2592000, private"
</FilesMatch>
<filesMatch "\\.(html|htm)$">
Header set Cache-Control "max-age=7200, public"
</filesMatch>
# Disable caching for scripts and other dynamic files
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>
# END Cache-Control Headers
# KILL THEM ETAGS
Header unset ETag
FileETag none
# protect the htaccess file
<files .htaccess>
order allow,deny
deny from all
</files>
et ne fonctionnera que sur des serveurs apaches 2.x.
http://news.netcraft.com/http://redbot.orghttp://askapache.info/1.3/mod/mod_expires.html### activate mod_expires
ExpiresActive On
### Expire les .gif .jpg .png .jpeg un mois après leur accès
ExpiresByType image/gif A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpeg A2592000
### Applique une en-tête Cache-Control à index.html -> à modifier si index.htm ou php
<Files index.html>
Header append Cache-Control "public, must-revalidate"
</Files>
bg62 a écrit:cette option n'existe pas sur un hébergement mutualisé (1&1) et ne peut pas être activée en aucun cas
bg62 a écrit:donc , in the baba ... ou autre solution ?

referenceur a écrit:tu peux toujours reprendre manuellement les rectifications à apporter mais il t'en faudra du temps !
bg62 a écrit:problème réglé !![]()
je viens de les avoir au téléphone : cette option n'existe pas sur un hébergement mutualisé (1&1) et ne peut pas être activée en aucun cas ...
donc , in the baba ...ou autre solution ?
<?php
header("Expires: la date qui va bien en GMT");
?>nifrou a écrit:dans ton cas autre solution
en php :
- Code: Tout sélectionner
<?php
header("Expires: la date qui va bien en GMT");
?>
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + 3600*24*7));

rsw a écrit:Comme moyen d'alléger tout ça (images), as-tu pensé au sprite ?
rsw a écrit:Oui, mais disons comme un pis-aller
http://www.aidewindows.net/pageweb_vitesse1.phphttp://permalink.gmane.org/gmane.comp.web.spip.user/167626laurent59 a écrit:Regarde ici :
- Code: Tout sélectionner
http://www.aidewindows.net/pageweb_vitesse1.php
Paragraphe : ExpiresActive On : mise en cache dans le fichier .htaccess
Tu as une fonction qui fonctionne chez 1and1... à tester
Tu as l'explication ici
- Code: Tout sélectionner
http://permalink.gmane.org/gmane.comp.web.spip.user/167626
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"
ExpiresByType image/jpg "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"
AddType image/x-icon .ico
ExpiresByType image/ico "access plus 2592000 seconds"
ExpiresByType image/icon "access plus 2592000 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType text/css "access plus 2592000 seconds"
ExpiresByType text/javascript "access plus 2592000 seconds"
ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType application/xhtml+xml "access plus 7200 seconds"
ExpiresByType application/javascript A259200
ExpiresByType application/x-javascript "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
</IfModule>
# Configure ETags
<FilesMatch "\.(jpg|jpeg|gif|png|mp3|flv|mov|avi|3pg|html|htm|swf|ico|cur)$">
FileETag MTime Size
</FilesMatch>
<IfModule mod_headers.c>
<FilesMatch "\\.(ico|jpeg|png|gif|swf|css|gz)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\\.(js)$">
Header set Cache-Control "max-age=2592000, private"
</FilesMatch>
<filesMatch "\\.(html|htm)$">
Header set Cache-Control "max-age=7200, public"
</filesMatch>
# Disable caching for scripts and other dynamic files
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>
if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start();header('Content-type: text/html; charset=utf-8');<?php ob_start("ob_gzhandler");header("Content-type: text/css; charset: utf-8");header("expires: Thu, 15 Apr 2015 20:00:00 GMT");header("Cache-Control: max-age=2592000");header("Last-Modified: Sat, 26 Feb 2010 12:45:26 GMT"); ?><?php ob_start("ob_gzhandler");header("Content-type: text/javascript; charset: utf-8");header("Cache-Control: max-age=2592000");header("expires: Thu, 15 Apr 2015 20:00:00 GMT");header("Last-Modified: Sat, 26 Feb 2010 12:45:26 GMT"); ?>bg62 a écrit:tu sais bien qu'apache et moi ....
que me conseilles-tu de mettre dans le .htaccess comme lignes pour tester ???
car là tu es beaucoup trop loin de mes modestes compétences ...
@+
Lexa a écrit:Chez 1and1 je mets ça dans le htaccess:

Retourner vers Développement d'un site web