Optimaal htaccess bestand voor snelle website*

  • john01
  • Onderwerp Auteur
  • Gebruiker
  • Gebruiker
Meer
10 okt 2017 20:58 #15238 door john01
Laat ik eens een script uit melken, en testen en testen dat ik het wel mooi genoeg vond.

Er zijn ongelooflijk veel scripts die aangeboden worden op internet, die je kunt plaatsen in de .htaccess bestand.

Zeer veel scripts zaten zoveel fouten is dat je de moed al rap op, echter ik hou van scripts uit te pluizen dat ze werken. Maar goed, dit script hieronder heb ik der mate uitgemolken dat er behoorlijke resultaat behaald kan worden. Iedere verandering die ik uitvoerde per regel, werd uitgetest op deze website GTmetrix

Waarom plaats ik dit script gedeelte?
De hoofd reden is, dat google weer eens fijn bezig is om een aantal dingen te veranderen dat waar een website houder aan moet voldoen. EN dat is snelheid, google zal binnenkort de langzame websites lager gaan indexeren. Ik ben van mening dat google nu wel een beetje veel macht uit oeffend naar website houders, dat als er eigenlijk niet echt een goed script te vinden is op internet. Nu kan je wel diverse modules aan gaan schaffen, echter valt ook daar best wel veel op aan te merken dat wat ze beloven.

Ik zou zeggen, probeer dit script eens, en test het op de website die hier in deze topic toegevoegd is.
Code:
## BEGIN EXPIRES CACHING ## <IfModule mod_expires.c> ExpiresActive on FileETag MTime Size AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript # 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 600 seconds" ExpiresByType application/xhtml+xml "access plus 600 seconds" # Your document html ExpiresByType text/html "access plus 1 seconds" # Data ExpiresByType text/xml "access plus 1 seconds" ExpiresByType application/xml "access plus 1 seconds" ExpiresByType application/json "access plus 1 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 year" # Media: images, video, audio ExpiresByType image/gif "access plus 1 year ExpiresByType image/png "access plus 1 year ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/jpeg "access plus 1 year 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/x-font-ttf "access plus 1 month" ExpiresByType font/opentype "access plus 1 month" ExpiresByType application/x-font-woff "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 seconds" ExpiresByType text/javascript "access plus 1 month" ExpiresByType application/javascript "access plus 1 month" ExpiresByType application/x-javascript "access plus 1 month" <IfModule mod_headers.c> Header append Cache-Control "public" <FilesMatch "\.(js|css|xml|gz)$"> Header append Vary: Accept-Encoding </FilesMatch> </IfModule> </IfModule> <IfModule mod_deflate.c> SetOutputFilter DEFLATE AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml text/x-js text/js </IfModule> <ifModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* </ifModule> ## END EXPIRES CACHING ##
Onderwerp is gesloten.
  • Gast
  • Gebruiker
  • Gebruiker
Meer
17 okt 2017 14:14 #15333 door Gast
Beantwoord door Gast in topic Optimaal htaccess bestand voor snelle website*
Code:
# 1 Month for most static assets <filesMatch ".(css|jpg|jpeg|png|svg|gif|js|ico)$"> Header set Cache-Control "max-age=2592000, public" </filesMatch>

of
Code:
## EXPIRES CACHING ## <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access 1 year" ExpiresByType image/jpeg "access 1 year" ExpiresByType image/gif "access 1 year" ExpiresByType image/png "access 1 year" ExpiresByType text/css "access 1 month" ExpiresByType text/html "access 1 month" ExpiresByType application/pdf "access 1 month" ExpiresByType text/x-javascript "access 1 month" ExpiresByType application/x-shockwave-flash "access 1 month" ExpiresByType image/x-icon "access 1 year" ExpiresDefault "access 1 month" </IfModule> ## EXPIRES CACHING ##

Verder hangen een aantal zaken ook af van je server- en Joomlaconfiguratie.
Onderwerp is gesloten.
  • john01
  • Onderwerp Auteur
  • Gebruiker
  • Gebruiker
Meer
17 okt 2017 16:18 #15337 door john01
Beantwoord door john01 in topic Optimaal htaccess bestand voor snelle website*
Klopt beide zijn bepaalde factoren, voor de snelheid van het geheel.
Joomla altijd eerst zonder enige plugins of componenten toe te voegen, de hoogste snelheid proberen te halen.
In de meeste gevallen hebben templates ook diverse instellingen die de snelheid kan verhogen dat wanneer die ingeschakeld staan.
Eigenlijk dat wat joomla standaard er al heeft instaan om de website optimaal te laten draaien.
Zodra men de resultaten ziet bij GTmetrix, kan men al snel achterhalen daar waar men moet zoeken om de website sneller te maken.

De server zoals een VPS, kan men namelijk ook zelf zeer veel instellingen inschakelen om de server te optimaliseren.

Is die mogelijkheid niet aanwezig, is het toevoegen van enkele script gedeeltes toe te voegen in de htaccess bestand. Het kan inderdaad ook zijn, dat toevallig het script zoals hierboven niet of niets uithaalt en dat ligt weer aan de server waar men gebruik van maakt.

Echter ben ik zelf ergens nog niet achter gekomen, dat waarom joomla steeds meer achteruit begint te lopen in snelheid.

dan een gedeelte uit het eerdere geplaatste script gedeelte, in de meeste gevallen staat dit er niet in, en of staat daar alles verkeerd zoals tijd of wat dan ook. Door dit geheel aan te passen en uit te blijven proberen, kom je er al snel achter dat de instellingen zoals hieronder in ieder geval op de VPS die ik draai het beste resultaat geeft op snelheid.
Code:
# Your document html ExpiresByType text/html "access plus 1 seconds" # Data ExpiresByType text/xml "access plus 1 seconds" ExpiresByType application/xml "access plus 1 seconds" ExpiresByType application/json "access plus 1 seconds" # Feed ExpiresByType application/rss+xml "access plus 1 hour" ExpiresByType application/atom+xml "access plus 1 hour"
Onderwerp is gesloten.
  • Hans van der Meer
  • Admin
  • Admin
  • Hans is een [b][u]echte Joomla[/u][/b] liefhebber en helpt als moderator op JoomlaCommunity, als med
Meer
18 okt 2017 04:55 #15347 door Hans van der Meer
Beantwoord door Hans van der Meer in topic Optimaal htaccess bestand voor snelle website*
Ik heb je topictitel wat aangepast voor verbeterde vindbaarheid, ook niet geheel onbelangrijk. ;)

Joostock mede-organisator, Moderator Joomlacommunity
Mede-organisator JoomlaDagen
ex Team Leader van Official Joomla Social Media Team & ex JUG-organisator
Eigen site: www.hierbenikthuis.nl
Onderwerp is gesloten.
Gemaakt door Kunena