Page 1 of 3

Speeding up CMSMS

Posted: Thu Jul 26, 2007 9:15 am
by taufikp
Here's what I do for my site (it's not accessible to public right now):
  • Open index.php
  • Scroll down until you see the header("Content-Type") line
  • Below that line add this: header("Content-Length: ".strlen($html));
  • Then add this line: header("Cache-Control: public, max-age=60, s-maxage=60");
For more info about those lines read Caching Tutorial for webmasters and web authors: http://www.mnot.net/cache_docs/

Re: Speeding up CMSMS

Posted: Mon Jul 30, 2007 1:47 pm
by Pierre M.
Hello,

Thank you.
I'm pretty sure this is what Apache's mod_cache is doing without touching CMSms' code.
But not all hosting providers provide mod_cache which they should love.

Pierre M.

Re: Speeding up CMSMS

Posted: Mon Jul 30, 2007 1:52 pm
by calguy1000
Though the content length mod should be harmless, the caching header should only be done if the page is marked as cachable..  dynamic pages (like those with content from FEU or CustomContent, etc), should not cache.

Re: Speeding up CMSMS

Posted: Thu Aug 16, 2007 11:04 am
by faglork
Hi!

Depending on the nature of your site, you might cache various elements via .htaccess file.

Here's what I use:

Code: Select all

ExpiresActive on
ExpiresByType image/gif "access plus 6 months"
ExpiresByType image/jpeg "access plus 6 months"
ExpiresByType image/png "access plus 6 months"
ExpiresByType text/css "access plus 6 months"
ExpiresByType text/javascript "access plus 6 months"
ExpiresByType text/html "access plus 1 day"
ExpiresByType application/x-javascript "access plus 6 months"

<Files ~ "\.(js|css|gif|jpg|png)$">
Header append Cache-Control "public"
</Files>
This is from a site which barely changes.

hth,
Alex

Re: Speeding up CMSMS

Posted: Thu Aug 16, 2007 12:06 pm
by cyberman
Hi Alex,

thanks for that (for me unknown) hints - will adding this to tuning guide :).

Re: Speeding up CMSMS

Posted: Thu Aug 16, 2007 2:59 pm
by faglork
Hi Andreas,

don't forget to add this link:
http://www.ircache.net/cgi-bin/cacheability.py

With this "cacheability engine"  you can check how the elements of your page are cached - nice for nailing down specific cache conditions.

Additionally I can recommend the "live http headers" extension for Firefox:
http://addons.mozilla.org/firefox/addon/3829

And as taufkip already mentioned, you have to understand
http://www.mnot.net/cache_docs/
first or you'll get in trouble.


Cheers,
Alex

Re: Speeding up CMSMS

Posted: Thu Aug 16, 2007 4:16 pm
by Pierre M.
Thank you Alex.
Andreas, where is the tuning guide ?
Have fun

Pierre M.

Re: Speeding up CMSMS

Posted: Thu Aug 16, 2007 5:00 pm
by cyberman
Pierre M. wrote: Andreas, where is the tuning guide ?
It's currently only available in german

http://forum.cmsmadesimple.org/index.ph ... 474.0.html

But maybe Google can help ;)

http://translate.google.com/translate?u ... de&ie=UTF8

(for french users only)

Hope you can understand it ...

Re: Speeding up CMSMS

Posted: Fri Aug 17, 2007 1:31 pm
by cyberman
OK, and here the link for all english speaking users

http://translate.google.com/translate?u ... uage_tools

(made this topic sticky)

Re: Speeding up CMSMS

Posted: Mon Aug 20, 2007 12:12 pm
by cyberman
faglork wrote: Depending on the nature of your site, you might cache various elements via .htaccess file.
Hmm, have tried it from a vserver, but got only a 500 error from server :-\ ...

What's wrong?

Re: Speeding up CMSMS

Posted: Mon Aug 20, 2007 12:56 pm
by Pierre M.
What is in the logs ?

Pierre M.

Re: Speeding up CMSMS

Posted: Mon Aug 20, 2007 1:45 pm
by faglork
cyberman wrote:
What's wrong?
Do you have mod_expires installed?

Alex

Re: Speeding up CMSMS

Posted: Mon Aug 20, 2007 5:07 pm
by cyberman
Thx Alex (and Pierre).

I see I must have tomatos on my eyes - mod_expires was not installed (I've afraid it) 8).

Re: Speeding up CMSMS

Posted: Tue Aug 21, 2007 6:59 am
by cyberman
faglork wrote: And as taufkip already mentioned, you have to understand
http://www.mnot.net/cache_docs/
Great document - I see, I have a lot to translate ;) ...

Re: Speeding up CMSMS

Posted: Tue Aug 21, 2007 1:48 pm
by Pierre M.
cyberman wrote:
faglork wrote: And as taufkip already mentioned, you have to understand
http://www.mnot.net/cache_docs/
Great document - I see, I have a lot to translate ;) ...
Yes, great. I like very much what is said about URLs, configs... And even already translated in French and Czech :)
Please notice : this march version is focused on browser side cache tuning (via mod_expires and mod_headers). May be the next will add mod_cache about webserver cache tuning in front of a "dynamic" content like CMSms (and obviously all expires and headers recommandations remain efficient).

Pierre M.