pb de cache sur les éléments static

Réduire
X
 
  • Filtrer
  • Heure
  • Afficher
Tout effacer
nouveaux messages

  • [RÉGLÉ] pb de cache sur les éléments static

    bonjour j'ai beaucoup lue sur le sujet et j'ai testé pas mal de chose, j'utilise cloudsflare

    mais webpage test http://www.webpagetest.org/

    m'indique toujours un grade d sur le static content,

    certains fichier css passe bien mais pas d'autres,

    le site est https://www.crashdebug.fr faite le test depuis http://www.webpagetest.org/

    voici les règle de mon .htaccess si quelqu'un pouvoir me dire ou sa pèche.

    merci beaucoup.


    #_________________________________________________ __________________________________________________ ______________________________________


    # Optimizing compression
    <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 application/x-javascript

    #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>

    #_________________________________________________ __________________________________________________ ______________________________________

    <IfModule mod_headers.c>
    ## optimisation keep alive
    Header set Connection keep-alive
    </IfModule>
    #_________________________________________________ __________________________________________________ ______________________________________

    # 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

    #_________________________________________________ __________________________________________________ ______________________________________

    # 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
    #_________________________________________________ __________________________________________________ ______________________________________

    # KILL THEM ETAGS
    Header unset ETag
    FileETag none
    #_________________________________________________ __________________________________________________ ______________________________________

    # protect the htaccess file
    <files .htaccess>
    order allow,deny
    deny from all
    </files>

    #_________________________________________________ __________________________________________________ ______________________________________



    AddCharset UTF-8 .html
    AddDefaultCharset UTF-8


    order allow,deny
    allow from all

  • #2
    Re : pb de cache sur les éléments static

    c'est bon j'ai réussi ! grade A !

    il fallait modifier le paramètre sur le CDN

    désolé du dérangement,

    Commentaire

    Annonce

    Réduire
    Aucune annonce pour le moment.

    Partenaire de l'association

    Réduire

    Hébergeur Web PlanetHoster
    Travaille ...
    X