Stop Caching

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.
Post Reply
darkknight
Forum Members
Forum Members
Posts: 15
Joined: Fri Nov 04, 2005 6:57 pm

Stop Caching

Post by darkknight »

Hi

I am using CMSMS 0.12 and am having a problem with the caching. The caching is working perfectly. However, I have included some php code on several pages which should spit up different content on each loading of the page - random images, random quotes, user specific content, etc. Since the coding of the page remains unchanged, even though the actual content should change, the Smarty caching system barfs up the page that it cached the first time the page was accessed.

For example, I have used in the template
                            {php}include("random_image.php:); {/php}

The image randomly genrated on the first loading of the page is the one seen thereafter unless I manually change the template in some manner.

Thus my question: is there a way to shut off the Smarty caching for specific pages, or, as a last resort, shut it off entirely.

I have not been able to find anything in these forums on the subject. Everything I have tried to alter the content of the page, other than manually changing the template, has not worked as the Smarty system checks 'content' before compiling the page rather than after. Excellent system for speed; a problem for variable content.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: Stop Caching

Post by Ted »

Your best bet is to use a user defined tag instead of {php}{/php}.  That will not do any caching.

However, you can also disable caching for a particular page by unchecking "Cachable" in the options tab while editing a page.
darkknight
Forum Members
Forum Members
Posts: 15
Joined: Fri Nov 04, 2005 6:57 pm

Re: Stop Caching

Post by darkknight »

Hi Ted

Thanks for the suggestions. I tried both of your suggestions before posting the first message. I also dumped the cache in the browser. I even shut down the server and re-started it.

I'm going to try one more thing - loading cmsms 0.12 on a couple of other servers. Maybe the issue resides in php.ini or apache settings on my sandbox server.
Post Reply

Return to “CMSMS Core”