Hoe afbeeldingen in cache zetten?

Discussieer hier over alles rondom phpBB.
Forumregels
LEES: Algemene Voorwaarden. Dit forum is niet voor technische vragen!
Plaats reactie
Gebruikersavatar
nl1sms
Berichten: 818
Lid geworden op: 12 mei 2005, 16:11
Locatie: Zaanstad

Hoe afbeeldingen in cache zetten?

Bericht door nl1sms » 06 apr 2018, 09:47

Ik heb website speed test gedaan en hij geeft aan dat een aantal bestanden (jpg) niet in de cache staan. Zoals o.a. site_logo.jpg/gif.

Hoe kan ik dit in de cache zetten? Het zijn toch afbeeldingen die vaak geladen worden bij het benaderen van de website. Kan dit in phpBB en zo ja hoe ? Thx

Gebruikersavatar
El torro
Berichten: 4165
Lid geworden op: 02 sep 2014, 21:28
Locatie: In het zonnige zuiden
Contacteer:

Re: Hoe afbeeldingen in cache zetten?

Bericht door El torro » 06 apr 2018, 17:59

Dat moet in de .htaccess

Hier hoe ik het heb gedaan:

Code: Selecteer alles

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 month"
ExpiresByType image/jpeg "access 1 month"
ExpiresByType image/gif "access 1 month"
ExpiresByType image/png "access 1 month"
ExpiresByType text/css "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 30 days"
</IfModule>
## EXPIRES CACHING ##

Gebruikersavatar
nl1sms
Berichten: 818
Lid geworden op: 12 mei 2005, 16:11
Locatie: Zaanstad

Re: Hoe afbeeldingen in cache zetten?

Bericht door nl1sms » 06 apr 2018, 18:04

Top! Maar zet hij die jpg etc dan in de cache van de browser van de bezoeker of is het echt de server waar hij in de cache komt ?
Laatst gewijzigd door nl1sms op 06 apr 2018, 18:13, 1 keer totaal gewijzigd.

Gebruikersavatar
El torro
Berichten: 4165
Lid geworden op: 02 sep 2014, 21:28
Locatie: In het zonnige zuiden
Contacteer:

Re: Hoe afbeeldingen in cache zetten?

Bericht door El torro » 06 apr 2018, 18:09

In de cache van de browser.

Gebruikersavatar
nl1sms
Berichten: 818
Lid geworden op: 12 mei 2005, 16:11
Locatie: Zaanstad

Re: Hoe afbeeldingen in cache zetten?

Bericht door nl1sms » 06 apr 2018, 18:13

Ok top..... ik heb het ook in mijn htaccess gezet..... Thx

Gebruikersavatar
Froddelaar
Berichten: 272
Lid geworden op: 29 mar 2016, 15:09
Locatie: Aalst, Belgie
Contacteer:

Re: Hoe afbeeldingen in cache zetten?

Bericht door Froddelaar » 06 apr 2018, 20:11

Met onderstaande haal ik een hoge score op https://tools.pingdom.com
En forum vliegt vooruit!

Code: Selecteer alles

# Enable Compression
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
</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>

# Leverage Browser 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>
<IfModule mod_headers.c>
  <filesmatch "\.(ico|flv|jpg|jpeg|png|gif|css|swf)$">
  Header set Cache-Control "max-age=2678400, public"
  </filesmatch>
  <filesmatch "\.(html|htm)$">
  Header set Cache-Control "max-age=7200, private, must-revalidate"
  </filesmatch>
  <filesmatch "\.(pdf)$">
  Header set Cache-Control "max-age=86400, public"
  </filesmatch>
  <filesmatch "\.(js)$">
  Header set Cache-Control "max-age=2678400, private"
  </filesmatch>
</IfModule>
Wij promoten UW muziek in ons forum & delen alles via Sociale media!
Muziek wordt ook toegevoegd in de playlist van
textradio.be!
Mail uw single + hoesje + info naar: info@muziekpromo.net of Solidjeuh@textradio.be
Onze Website: https://www.muziekpromo.net

Gebruikersavatar
El torro
Berichten: 4165
Lid geworden op: 02 sep 2014, 21:28
Locatie: In het zonnige zuiden
Contacteer:

Re: Hoe afbeeldingen in cache zetten?

Bericht door El torro » 06 apr 2018, 21:15

¿En dan zet je gzip op het forum en in cPanel uit?

Gebruikersavatar
Froddelaar
Berichten: 272
Lid geworden op: 29 mar 2016, 15:09
Locatie: Aalst, Belgie
Contacteer:

Re: Hoe afbeeldingen in cache zetten?

Bericht door Froddelaar » 06 apr 2018, 21:32

El torro schreef:
06 apr 2018, 21:15
¿En dan zet je gzip op het forum en in cPanel uit?
gzip in het beheerderspaneel staat uit.
Is ingeschakeld op de server.
Wij promoten UW muziek in ons forum & delen alles via Sociale media!
Muziek wordt ook toegevoegd in de playlist van
textradio.be!
Mail uw single + hoesje + info naar: info@muziekpromo.net of Solidjeuh@textradio.be
Onze Website: https://www.muziekpromo.net

Gebruikersavatar
nl1sms
Berichten: 818
Lid geworden op: 12 mei 2005, 16:11
Locatie: Zaanstad

Re: Hoe afbeeldingen in cache zetten?

Bericht door nl1sms » 07 apr 2018, 08:58

@Froddelaar Kan ik jouw htaccess ook gebruiken zonder dat ik gzip aan heb op de server noch control panel?

Gebruikersavatar
Froddelaar
Berichten: 272
Lid geworden op: 29 mar 2016, 15:09
Locatie: Aalst, Belgie
Contacteer:

Re: Hoe afbeeldingen in cache zetten?

Bericht door Froddelaar » 07 apr 2018, 12:37

nl1sms schreef:
07 apr 2018, 08:58
@Froddelaar Kan ik jouw htaccess ook gebruiken zonder dat ik gzip aan heb op de server noch control panel?
Volgens mij moet de gzip module toch wel aanstaan op de server.
Anders zal die cache niet werken ..
Beide inschakelen is niet goed, want daarmee kreeg "cache" ik foutmeldingen bij enkele extensies.
Wij promoten UW muziek in ons forum & delen alles via Sociale media!
Muziek wordt ook toegevoegd in de playlist van
textradio.be!
Mail uw single + hoesje + info naar: info@muziekpromo.net of Solidjeuh@textradio.be
Onze Website: https://www.muziekpromo.net

Gebruikersavatar
nl1sms
Berichten: 818
Lid geworden op: 12 mei 2005, 16:11
Locatie: Zaanstad

Re: Hoe afbeeldingen in cache zetten?

Bericht door nl1sms » 07 apr 2018, 13:10

Dit er uit halen dus ?

Code: Selecteer alles

# Enable Compression
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
</IfModule>

Gebruikersavatar
Froddelaar
Berichten: 272
Lid geworden op: 29 mar 2016, 15:09
Locatie: Aalst, Belgie
Contacteer:

Re: Hoe afbeeldingen in cache zetten?

Bericht door Froddelaar » 07 apr 2018, 14:39

nl1sms schreef:
07 apr 2018, 13:10
Dit er uit halen dus ?

Code: Selecteer alles

# Enable Compression
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
</IfModule>
Goh geen idee, ik heb het er allemaal instaan.
gzip ingeschakeld op de server & uitgeschakeld in beheerderspaneel van het forum.
Wij promoten UW muziek in ons forum & delen alles via Sociale media!
Muziek wordt ook toegevoegd in de playlist van
textradio.be!
Mail uw single + hoesje + info naar: info@muziekpromo.net of Solidjeuh@textradio.be
Onze Website: https://www.muziekpromo.net

Plaats reactie