Caching and menus Topic is solved
Caching and menus
Hi can you explain why the menu system is not cached with the rest of the page, this causes a huge load on a large cms and i cant understand why its that way.?
Also has anyone got any tuning tips for cmsms as it seems very resource hungry
Im not complaining, i love the cmsms and appreciate all the hard work thats put into it, its just a couple of things that would make it perfect
Thanks
Also has anyone got any tuning tips for cmsms as it seems very resource hungry
Im not complaining, i love the cmsms and appreciate all the hard work thats put into it, its just a couple of things that would make it perfect
Thanks
Re: Caching and menus
I thinked alot of time to do something like that.fadum wrote: Hi can you explain why the menu system is not cached with the rest of the page, this causes a huge load on a large cms and i cant understand why its that way.?
Also has anyone got any tuning tips for cmsms as it seems very resource hungry
Im not complaining, i love the cmsms and appreciate all the hard work thats put into it, its just a couple of things that would make it perfect
Thanks
It's a nice request.
Re: Caching and menus
Yes, it's been running through my head as well that we need this. i have a few ideas, but I'm afraid to make any more major changes before 0.11/1.0.
I actually like the pimenu idea of sorts, though some wrappers and a better caching mechanism would have to be put into place, but it's going in the right direction.
I actually like the pimenu idea of sorts, though some wrappers and a better caching mechanism would have to be put into place, but it's going in the right direction.
Re: Caching and menus
In the mean time i have added my own caching on the index.php that just checks the last modified date and creates a cache of the page by storing it and calling it if the modified date is before the create date, simple and very effective, VERY fast pages 1 query loaded in 0.002secs
Can you answer why the menu isnt cached? when the rest of the content is.
Thanks
Can you answer why the menu isnt cached? when the rest of the content is.
Thanks
Re: Caching and menus
Honest answer? I never thought of it. As soon as I saw the idea, I kind of smacked myself on the head and wondered what I was thinking.
Can you pass that code along? I'm curious to see what you did.
Can you pass that code along? I'm curious to see what you did.
Re: Caching and menus
Here we go, its VERY rough as i was just trying it out.
Code: Select all
// Top after copyright info
$pagee = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; // Requested page
$cacheext = 'html';
$cachedir = "/path/path/public_html/my/cache/";
$chkdt = str_replace("/","",str_replace(".html","",$_SERVER['REQUEST_URI']));
$query = "SELECT modified_date as mody FROM cms_content where content_alias='$chkdt'";
$result = mysql_query($query) or die("Error: " . mysql_error());
$row=mysql_fetch_assoc($result);
$mody = $row["mody"];
$modunix=strtotime("$mody");
$ignore_list = array(
'mysite.com/rss.php',
'mysite.com/search/'
);
require_once("lib/misc.functions.php");
$cachetime = 120000; // Seconds to cache files for just a safeguard
$cachefile = $cachedir . md5($pagee) . '.' . $cacheext; // Cache file to either load or create
$ignore_page = false;
for ($i = 0; $i < count($ignore_list); $i++) {
$ignore_page = (strpos($page, $ignore_list[$i])!== false)? true : $ignore_page;
}
$cachefile_created = ((@file_exists($cachefile)) and ($ignore_page === false))? @filemtime($cachefile) : 0;
@clearstatcache();
if ($modunix < $cachefile_created) {
@readfile($cachefile);
$endtime = microtime();
exit();
}
// no cache or old cache so we are still here so heres the original php stuff
blah blah
// Near bottom of page
// Now the script has run, generate a new cache
$fp = @fopen($cachefile, 'w');
@fwrite($fp, ob_get_contents());
@fclose($fp);
ob_end_flush();
Re: Caching and menus
Use pimenu - you can create your own menus via smarty and yoou can make ist static or dynamic.
5000 !!! Pages - Menu
Generated in 0.443242 seconds by CMS Made Simple 0.11-beta4 (cached) using 9 SQL queries
== 0.0000886484 seconds one page.
5000 !!! Pages - Menu
Generated in 0.443242 seconds by CMS Made Simple 0.11-beta4 (cached) using 9 SQL queries
== 0.0000886484 seconds one page.
Re: Caching and menus
No pimenu is not ellnav.
pimenu is a small plugin that delivers all datas from the cms and some logical datas that you need to build a menu with smarty.
you can compose ellnav with pimenu - you must only write a template.
you can use nearly all menusystems there are on the market - if you compose a smarty - template.
pimenu is a small plugin that delivers all datas from the cms and some logical datas that you need to build a menu with smarty.
you can compose ellnav with pimenu - you must only write a template.
you can use nearly all menusystems there are on the market - if you compose a smarty - template.
Re: Caching and menus
plugin in the plugin folder
templates in the tmp/templates_c folder
all cms standard.
templates in the tmp/templates_c folder
all cms standard.
Re: Caching and menus
Maybe a .2 speed release would be in order? I noticed the lag on my fully implemented site today. None of my 56k users will notice it, but i notice it on my broadband. I think the sign of a good product includes the tuning aspect. (btw... i'll help if i can)wishy wrote: Yes, it's been running through my head as well that we need this. i have a few ideas, but I'm afraid to make any more major changes before 0.11/1.0.
I actually like the pimenu idea of sorts, though some wrappers and a better caching mechanism would have to be put into place, but it's going in the right direction.
Thoughts?
Re: Caching and menus
Version 3 should be the speed version you mean - it is now beta.Maybe a .2 speed release would be in order?
Re: Caching and menus
where is 3?Piratos wrote:Version 3 should be the speed version you mean - it is now beta.Maybe a .2 speed release would be in order?
Re: Caching and menus
I'm talking about the CMSMs CORE, not the PIMENU. Sorry for the confusion.Piratos wrote:Version 3 should be the speed version you mean - it is now beta.Maybe a .2 speed release would be in order?