Joomla.it Forum
Joomla! 3 => Joomla! 3 => : squalogu 02 May 2018, 15:59:11
-
Salve, sto provando a eseguire questa ottimizzazione, ho letto che occorre aggiungere delle stringhe sul fil htaccess ma non è migliorato., avete consigli o è una cosa che dipende dal provider?
-
ciao squalogu,
io uso il plugn jch optimize pro, ma il tuo obiettivo può essere raggiunto modificando come hai giustamente scritto il file .htaccess.
Jch va infatti a modificarlo in questo modo:
## BEGIN EXPIRES CACHING - JCH OPTIMIZE ##
<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 month"
# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Your document html
ExpiresByType text/html "access plus 0 seconds"
# Data
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
# Feed
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/atom+xml "access plus 1 hour"
# Favicon (cannot be renamed)
ExpiresByType image/x-icon "access plus 1 week"
# Media: images, video, audio
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
# HTC files (css3pie)
ExpiresByType text/x-component "access plus 1 month"
# Webfonts
ExpiresByType application/font-ttf "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType application/font-woff2 "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
# CSS and JavaScript
ExpiresByType text/css "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
<IfModule mod_headers.c>
Header append Cache-Control "public"
</IfModule>
</IfModule>
-
conosco quel plugin, spesso mi ha creato problemi.
provo a introdurre manualmente queste stringhe
grazie
-
ottimo! grazie
hai per caso anche la stringa per: Defer parsing of JavaScript?
-
il defer javascript non si risolve con l'.htaccess
Defer javascript vuol dire in poche parole caricare gli script una volta che l'html è stato caricato. Lo puoi fare ad esempio con uno script che si carichi appena prima della chiusura del body (</body>) piazzato in un modulo custom, in modo tale che carichi tutti i tuoi .js alla fine del caricamento dell'html.
In rete se cerchi un po' trovi diversi esempi.
In alternativa ci sono estensioni, che mi sa già conosci.
Nota che caricare gli script alla fine può causare problemi, se gli script servono all'html!
-
ok grazie