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.

MyFootballCafe.com  is Now Online!

Re: Is this ok, optimising load speed with cache

In punbb 1.4 JS files loaded in async mode - no need combine it.

Re: Is this ok, optimising load speed with cache

I wondered is there any to optimize the cache for punbb? For example to use html minify, maybe combine the images into sprites etc.

Re: Is this ok, optimising load speed with cache

well, i did alot of stuff with my forums, some of the images (especially in the main page, those small icons), i sprited them.

i am also using gzip, but there is a problem in that as it doesnt gzip the css files.

i also used the cache through htaccess, also added the expiry header thing, and vary header (gzip or no gzip), many stuff i did through htaccess, it i thinked helped increase the forums speed alot. also shows good result now in google pagespeed.

here is what i added to 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>

<IfModule mod_deflate.c>
    #The following line is enough for .js and .css
    AddOutputFilter DEFLATE js css

    #The following line also enables compression by file content type, for the following list of Content-Type:s
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml

    #The following lines are to avoid bugs with some browsers
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html 
</IfModule>
MyFootballCafe.com  is Now Online!

Re: Is this ok, optimising load speed with cache

i am also using gzip, but there is a problem in that as it doesnt gzip the css files.

Re: Is this ok, optimising load speed with cache

blueman wrote:

i am also using gzip, but there is a problem in that as it doesnt gzip the css files.

yes me too, i have problem using gzip T__T

sorry my BAD english T___T
Have a nice day >.<
(^____^)v

Re: Is this ok, optimising load speed with cache

Gzip issues here as well. Although GTmetrix is giving me a 93 so I don't think it's too big of a deal.

Re: Is this ok, optimising load speed with cache

it seems we have a problem with gzip, I am using too and it does not gzip the css.