Page 1 of 1

Caching in SVN Version broke?

Posted: Thu Oct 06, 2005 3:46 am
by Gizmo
I think there's something wonky with the 'Cachable' setting in the SVN Oct/5. I think that CMSMS/Smarty are ignoring the 'Cachable' setting on a page when it is unchecked and caching regardless.

Quick test:

1. Create new page with {php}echo time();{/php}.
2. Change page setting to uncheck 'cachable'.
3. Clear tmp/cache and tmp/templates_c.
4. Load page.

Comment in tag at bottom of page reads 'Not cached' (expected).

5. Reload page.

Produces: Comment reads 'cached'.
Expected: 'Not cached'

Just wanted to mention it if it wasn't already known. I assume it's a bug? I'm still trying to dig through the CMSMS code to figure out how it renders pages, calls smarty and such.

Re: Caching in SVN Version broke?

Posted: Thu Oct 06, 2005 9:42 am
by Ted
Actually, the cached/not cached thing doesn't quite work the same anymore.

Because of the change in architecture, content, templates and html blobs are now cached separately.  That variable still shows whether or not the template was cached.  So, even if the content itself is not caching, that will still show cached.  It was programmed so that it still respects cachable checkbox, but it's obviously not as easy to test anymore.  :)

Re: Caching in SVN Version broke?

Posted: Thu Oct 06, 2005 4:17 pm
by Gizmo
Ok cool. I'm trying to embed SMF into the content area of 0.11cvn, which is how I encountered the problem described above. The "test" page described above works perfectly fine and outputs the time every time the page is loaded, as expected. Apparently the actual php code block is being cached, not the value it returns (sensible behaviour). So then I tried embeding my forum code as per my earlier topic (works with 0.10 on PHP4.. although now I'm on 0.11 with PHP5), which is basically just a fancy require() statement and I get two different behaviours.

The first time the page loads, it loads almost perfectly with the small glitch of having all these {nocache} tags strewn about the place.

The second time the page is loaded (from cache), the content area doesn't change. Even if you access ?page=Forum&board=2.0 you always get a copy of whatever page was displayed first (which isn't necessarily the forum index page - the input parameters *are* being passed along correctly to the forum). It seems that the result of the code, rather than the code itself, is being cached. I've tried embeding the code in the page content with {php} tags, and also by putting it in a custom tag and the result is the same.

Also, when the page is displayed for the second time, the top part of the template page is missing. All that is displayed on the page is the stored content, and the bottom part of the main template, which is a bit odd. I've included screenshots of what is returned the first and second time the page is loaded.

My only guess at this point is that SMF is tossing an exception at some point, or maybe it's polluting one of CMSMS's variables.. it may also be tossing up an exit() call at some point, which is throwing things through a loop. Either way it's clear that the forum code isn't just "some" innocent php code that CMSMS hands off and returns the result... something in it is making it sick, which I'll have to figure out.

Let me know if this template/cache behaviour points to something obvious. I have a feeling I'm going to have to trace through the content and cache code in order to get this working. I tried sticking in a bunch of error_reporting(E_ALL) calls in CMSMS/SMF but that hasn't turned up anything.

[attachment deleted by admin]

Re: Caching in SVN Version broke?

Posted: Sun Oct 23, 2005 8:22 pm
by Gizmo
Just got back from hiatus and am back to trying to make this work. I tried sticking the forum code into a module rather than a custom tag, but it behaves exactly the same. Does this odd behaviour strike any obvious cords to any of you caching experts? I'd really like to get this going. Embeded forum into CMSMS would be infinitely excellent.

Re: Caching in SVN Version broke?

Posted: Sun Oct 23, 2005 11:55 pm
by Ted
A lot of times it's related to a bug that smarty doesn't want to display properly.  Try turning on debug in config.php, which will put smarty into debug mode as well.  Sometimes you can get better messages out of it that way.

Re: Caching in SVN Version broke?

Posted: Mon Nov 28, 2005 8:49 am
by KnightWolfJK
Gizmo: any luck with this?  I'm trying to intergrate Gallery2 and am getting a bunch of NOCACHE errors as well.

Re: Caching in SVN Version broke?

Posted: Mon Jan 16, 2006 9:34 pm
by steve
I'm getting the same problem with the stats module. Did you find a solution at all?

Steve

Re: Caching in SVN Version broke?

Posted: Tue Jan 17, 2006 4:05 am
by KnightWolfJK
Steve- I forget what the specific fix was, but in my case it was user error and nothing CMSMS related.  Are you using the SVN version?

Re: Caching in SVN Version broke?

Posted: Fri Feb 10, 2006 12:42 am
by Gizmo
Apparently the caching has been fixed up again in 0.12. I haven't checked it out.

Essentially I got around this in 0.11 by ripping out all the caching. Ugly, I know, but it was for a very small site and, more importantly, it worked. Unfortunately it's been a while since I drudged through this stuff, so I can't offer much in the way of technical specifics.

Re: Caching in SVN Version broke?

Posted: Tue Mar 28, 2006 6:46 pm
by petert
Patricia wrote: "no cache" is not an error of the cache itself, it's an information that the page is not caching BECAUSE there is an error in the page.
I just found out that having to many modules (i.e. running out of memory) will generate loads of nochache; errors too.
I removed the unwanted/unused modules and the errors went away and everything worked again as always: perfectly!

thanks guys for all the hard work!

Re: Caching in SVN Version broke?

Posted: Tue Mar 28, 2006 6:48 pm
by calguy1000
yes, in order to use a wide variety of modules in CMS you may have to increase your php_memory limit to 16 or more mb.  as well, if you allow file uploading, you may have to do the same.