Caching in SVN Version broke?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
Gizmo

Caching in SVN Version broke?

Post 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.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Caching in SVN Version broke?

Post 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.  :)
Gizmo

Re: Caching in SVN Version broke?

Post 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]
Gizmo

Re: Caching in SVN Version broke?

Post 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.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Caching in SVN Version broke?

Post 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.
KnightWolfJK

Re: Caching in SVN Version broke?

Post by KnightWolfJK »

Gizmo: any luck with this?  I'm trying to intergrate Gallery2 and am getting a bunch of NOCACHE errors as well.
steve
Forum Members
Forum Members
Posts: 70
Joined: Mon Apr 11, 2005 12:31 pm

Re: Caching in SVN Version broke?

Post by steve »

I'm getting the same problem with the stats module. Did you find a solution at all?

Steve
KnightWolfJK

Re: Caching in SVN Version broke?

Post 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?
Gizmo

Re: Caching in SVN Version broke?

Post 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.
Last edited by Gizmo on Fri Feb 10, 2006 12:46 am, edited 1 time in total.
User avatar
petert
Power Poster
Power Poster
Posts: 282
Joined: Wed Feb 09, 2005 9:30 pm

Re: Caching in SVN Version broke?

Post 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!
Mambo sucks, that's why I am here.
Now they call it Joomla, but it still sucks!

CMSMS rules!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Caching in SVN Version broke?

Post 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.
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.
Locked

Return to “CMSMS Core”