- 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");
Speeding up CMSMS
Speeding up CMSMS
Here's what I do for my site (it's not accessible to public right now):
Re: Speeding up CMSMS
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.
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.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Speeding up CMSMS
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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Speeding up CMSMS
Hi!
Depending on the nature of your site, you might cache various elements via .htaccess file.
Here's what I use:
This is from a site which barely changes.
hth,
Alex
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>
hth,
Alex
Re: Speeding up CMSMS
Hi Alex,
thanks for that (for me unknown) hints - will adding this to tuning guide
.
thanks for that (for me unknown) hints - will adding this to tuning guide

Re: Speeding up CMSMS
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
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
Last edited by faglork on Thu Aug 16, 2007 3:04 pm, edited 1 time in total.
Re: Speeding up CMSMS
Thank you Alex.
Andreas, where is the tuning guide ?
Have fun
Pierre M.
Andreas, where is the tuning guide ?
Have fun
Pierre M.
Re: Speeding up CMSMS
It's currently only available in germanPierre M. wrote: Andreas, where is the tuning guide ?
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 ...
Last edited by cyberman on Fri Aug 17, 2007 1:28 pm, edited 1 time in total.
Re: Speeding up CMSMS
OK, and here the link for all english speaking users
http://translate.google.com/translate?u ... uage_tools
(made this topic sticky)
http://translate.google.com/translate?u ... uage_tools
(made this topic sticky)
Re: Speeding up CMSMS
Hmm, have tried it from a vserver, but got only a 500 error from serverfaglork wrote: Depending on the nature of your site, you might cache various elements via .htaccess file.

What's wrong?
Re: Speeding up CMSMS
Do you have mod_expires installed?cyberman wrote:
What's wrong?
Alex
Re: Speeding up CMSMS
Thx Alex (and Pierre).
I see I must have tomatos on my eyes - mod_expires was not installed (I've afraid it)
.
I see I must have tomatos on my eyes - mod_expires was not installed (I've afraid it)

Re: Speeding up CMSMS
Great document - I see, I have a lot to translatefaglork wrote: And as taufkip already mentioned, you have to understand
http://www.mnot.net/cache_docs/

Re: Speeding up CMSMS
Yes, great. I like very much what is said about URLs, configs... And even already translated in French and Czechcyberman wrote:Great document - I see, I have a lot to translatefaglork wrote: And as taufkip already mentioned, you have to understand
http://www.mnot.net/cache_docs/...

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.