Risultati da 1 a 3 di 3

Discussione: Ottimizzazione .htaccess

  1. #1

    Ottimizzazione .htaccess

    Ciao ragazzi, pagespeed mi segnala questo problema (da ieri):

    Nelle seguenti risorse manca una convalida della cache. Le risorse che non specificano una convalida della cache non possono essere aggiornate in modo efficiente. Specifica un'intestazione Last-Modified o ETag per abilitare la convalida della cache per le seguenti risorse:

    I file segnalati sono quasi tutti .png

    Vi incollo il mio .htaccess, mi dite se secondo voi è ok o se bisogna apportare delle modifiche? Grazie!

    RewriteEngine on


    # This file is only needed if you have set the Forum Component URL in your admincp and you are
    # using the mod_rewrite option for friendly urls. If this is the case, copy this file
    # to your forum component stub directory.


    # If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your forum component directory.
    # RewriteBase /forum-stub-directory/


    # If you are having problems with the rewrite from content/ to , uncomment this line to turn MultiViews off.
    # Options -MultiViews


    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d


    RewriteRule ^.*$ - [NC,L]


    # Forum
    RewriteRule ^threads/.* showthread.php [QSA]
    RewriteRule ^forums/.* forumdisplay.php [QSA]
    RewriteRule ^members/.* member.php [QSA]


    RewriteEngine On
    RewriteRule ((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]




    # aggiunta inizio
    # BEGIN Browser Caching/Headers
    <IfModule mod_mime.c>
    AddType text/css .css
    AddType application/x-javascript .js
    AddType text/richtext .rtf .rtx
    AddType image/svg+xml .svg .svgz
    AddType text/plain .txt
    AddType text/xsd .xsd
    AddType text/xsl .xsl
    AddType video/asf .asf .asx .wax .wmv .wmx
    AddType video/avi .avi
    AddType image/bmp .bmp
    AddType application/java .class
    AddType video/divx .divx
    AddType application/msword .doc .docx
    AddType application/x-msdownload .exe
    AddType image/gif .gif
    AddType application/x-gzip .gz .gzip
    AddType image/x-icon .ico
    AddType image/jpeg .jpg .jpeg .jpe
    AddType application/vnd.ms-access .mdb
    AddType audio/midi .mid .midi
    AddType video/quicktime .mov .qt
    AddType audio/mpeg .mp3 .m4a
    AddType video/mp4 .mp4 .m4v
    AddType video/mpeg .mpeg .mpg .mpe
    AddType application/vnd.ms-project .mpp
    AddType application/vnd.oasis.opendocument.database .odb
    AddType application/vnd.oasis.opendocument.chart .odc
    AddType application/vnd.oasis.opendocument.formula .odf
    AddType application/vnd.oasis.opendocument.graphics .odg
    AddType application/vnd.oasis.opendocument.presentation .odp
    AddType application/vnd.oasis.opendocument.spreadsheet .ods
    AddType application/vnd.oasis.opendocument.text .odt
    AddType audio/ogg .ogg
    AddType application/pdf .pdf
    AddType image/png .png
    AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx
    AddType audio/x-realaudio .ra .ram
    AddType application/x-shockwave-flash .swf
    AddType application/x-tar .tar
    AddType image/tiff .tif .tiff
    AddType audio/wav .wav
    AddType audio/wma .wma
    AddType application/vnd.ms-write .wri
    AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
    AddType application/zip .zip
    </IfModule>
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css A31536000
    ExpiresByType application/x-javascript A31536000
    ExpiresByType text/richtext A3600
    ExpiresByType image/svg+xml A3600
    ExpiresByType text/plain A3600
    ExpiresByType text/xsd A3600
    ExpiresByType text/xsl A3600
    ExpiresByType video/asf A31536000
    ExpiresByType video/avi A31536000
    ExpiresByType image/bmp A31536000
    ExpiresByType application/java A31536000
    ExpiresByType video/divx A31536000
    ExpiresByType application/msword A31536000
    ExpiresByType application/x-msdownload A31536000
    ExpiresByType image/gif A31536000
    ExpiresByType application/x-gzip A31536000
    ExpiresByType image/x-icon A31536000
    ExpiresByType image/jpeg A31536000
    ExpiresByType application/vnd.ms-access A31536000
    ExpiresByType audio/midi A31536000
    ExpiresByType video/quicktime A31536000
    ExpiresByType audio/mpeg A31536000
    ExpiresByType video/mp4 A31536000
    ExpiresByType video/mpeg A31536000
    ExpiresByType application/vnd.ms-project A31536000
    ExpiresByType application/vnd.oasis.opendocument.database A31536000
    ExpiresByType application/vnd.oasis.opendocument.chart A31536000
    ExpiresByType application/vnd.oasis.opendocument.formula A31536000
    ExpiresByType application/vnd.oasis.opendocument.graphics A31536000
    ExpiresByType application/vnd.oasis.opendocument.presentation A31536000
    ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000
    ExpiresByType application/vnd.oasis.opendocument.text A31536000
    ExpiresByType audio/ogg A31536000
    ExpiresByType application/pdf A31536000
    ExpiresByType image/png A31536000
    ExpiresByType application/vnd.ms-powerpoint A31536000
    ExpiresByType audio/x-realaudio A31536000
    ExpiresByType application/x-shockwave-flash A31536000
    ExpiresByType application/x-tar A31536000
    ExpiresByType image/tiff A31536000
    ExpiresByType audio/wav A31536000
    ExpiresByType audio/wma A31536000
    ExpiresByType application/vnd.ms-write A31536000
    ExpiresByType application/vnd.ms-excel A31536000
    ExpiresByType application/zip A31536000
    </IfModule>
    <IfModule mod_deflate.c>
    <IfModule mod_setenvif.c>
    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
    </IfModule>
    <IfModule mod_headers.c>
    Header append Vary User-Agent env=!dont-vary
    </IfModule>
    <IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
    </IfModule>
    </IfModule>
    <FilesMatch "\.(css|js|CSS|JS)$">
    <IfModule mod_headers.c>
    Header set Pragma "public"
    Header append Cache-Control "public, must-revalidate, proxy-revalidate"
    </IfModule>
    FileETag MTime Size
    <IfModule mod_headers.c>
    Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
    </IfModule>
    </FilesMatch>
    <FilesMatch "\.(rtf|rtx|svg|svgz|txt|xsd|xsl|RTF|RTX|SVG|SVGZ| TXT|XSD|XSL|)$">
    <IfModule mod_headers.c>
    Header set Pragma "public"
    Header append Cache-Control "public, must-revalidate, proxy-revalidate"
    </IfModule>
    FileETag MTime Size
    <IfModule mod_headers.c>
    Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
    </IfModule>
    </FilesMatch>
    <FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|doc x|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mo v|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf| odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ra m|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xl w|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|D OCX|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|MDB|MID|MIDI| MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|ODB|ODC|OD F|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA| RAM|SWF|TAR|TIF|TIFF|WAV|WMA|WRI|XLA|XLS|XLSX|XLT| XLW|ZIP)$">
    <IfModule mod_headers.c>
    Header set Pragma "public"
    Header append Cache-Control "public, must-revalidate, proxy-revalidate"
    </IfModule>
    FileETag MTime Size
    <IfModule mod_headers.c>
    Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
    </IfModule>
    </FilesMatch>
    # End Browser Caching/Headers


    # aggiunta fine




    #Compression
    <IfModule mod_headers.c>
    <IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/css text/xml text/javascript application/x-javascript application/javascript
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    </IfModule>
    </IfModule>

  2. #2
    Inattivo
    Data Registrazione
    Jul 2006
    Località
    Porto Recanati, Italy
    Età
    41
    Messaggi
    871
    Questo avviso ti viene fuori quando?

  3. #3
    Su pagespeed! Prima era in medium priority, ora in low!

    Altre due cosine, se non disturbo!

    1) Come posso fare per combinare le immagini in sprite css? Il codice che ho inserito alla fine del file .htaccess è corretto? Sono su server dedicato managed, devo far abilitare qualcosa? In opzioni Cookie e Header, abilito o disabilito la compressione gzip delle pagine html?

    2) Gmetrix mi segnala che ci sono tantissimo CSS inutilizzati (oltre il 50%). Come si fa a disabilitarli? è una cosa rischiosa?

    Ah, per chiudere: keep alive me lo deve attivare chi gestisce il server, vero?

    Grazie!

Discussioni Simili

  1. Sitemap e htaccess
    Di alberto464 nel forum Come faccio
    Risposte: 6
    Ultimo Messaggio: 06-01-2012, 13:45
  2. problema file .htaccess
    Di crazyclown nel forum Mod e Template
    Risposte: 0
    Ultimo Messaggio: 22-01-2010, 21:11
  3. file .htaccess
    Di )AleX( nel forum Agorà di vBulletin
    Risposte: 2
    Ultimo Messaggio: 30-06-2009, 22:18
  4. EBook - L’ottimizzazione delle URL sui Forum
    Di cionfs nel forum Agorà di vBulletin
    Risposte: 2
    Ultimo Messaggio: 25-10-2008, 14:28
  5. vBulletin 3.0.x Apache: .htaccess
    Di y2ksw nel forum VBulletin 3
    Risposte: 1
    Ultimo Messaggio: 20-04-2005, 22:38

Segnalibri

Permessi di Scrittura

  • Tu non puoi inviare nuove discussioni
  • Tu non puoi inviare risposte
  • Tu non puoi inviare allegati
  • Tu non puoi modificare i tuoi messaggi
  •