Topic: Is this ok, optimising load speed with cache
Caching:
Recently i went accross a google page speed test, where they tested many stuff. https://developers.google.com/speed/pagespeed
I found out that punbb doesnt do "Leverage browser caching" for css,js and img(png,jpg,gif etc) files. So i had to do that manually by putting the following code into my htaccess.
# Expires Headers - 2678400s = 31 days
<ifmodule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType image/gif "access plus 2678400 seconds"
ExpiresByType image/jpeg "access plus 2678400 seconds"
ExpiresByType image/png "access plus 2678400 seconds"
ExpiresByType text/css "access plus 518400 seconds"
ExpiresByType text/javascript "access plus 2678400 seconds"
ExpiresByType application/x-javascript "access plus 2678400 seconds"
</ifmodule>
# Cache Headers
<ifmodule mod_headers.c>
# Cache specified files for 31 days
<filesmatch "\.(ico|flv|jpg|jpeg|png|gif|css|swf)$">
Header set Cache-Control "max-age=2678400, public"
</filesmatch>
# Cache Javascripts for 31 days
<filesmatch "\.(js)$">
Header set Cache-Control "max-age=2678400, private"
</filesmatch>
</ifmodule>
<FilesMatch "\.(php)$">
<IfModule mod_headers.c>
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
</IfModule>
</FilesMatch>
And that i think made some difference in speed as the google pagespeed doesnt show errors now.
Extensions CSS and JS files:
Most of the speed test websites showed concerns about my site multiple css and js files are being loaded because i use many extensions, i think 8css files and 6js files are loaded.
The speedtest websites wants me to merge this, which i cant because if i copyed their css code to my main theme, i still cant stop the extensions to load these files. same goes for js files.
i was thinking, is their a way for extensions to just load these codes directly into the main css / js file, likes the hooks system, adding a hook to css where you can put files, i know this sounds crazy since i am not a coder so i have no idea if this possible or not. anyway that was the idea.