Page 1 of 1

Remove caching for one page????

Posted: Wed Aug 01, 2007 4:10 pm
by mickscool
Hi Friends,
I have cache enabled on my website to improve the performance. But i have a scoreboard rss feed, that i need to refresh every minute. Is it possible to remove that particular page from caching somehow,instead of disabling the cache feature on the whole site???

Thanks
Mick

Re: Remove caching for one page????

Posted: Wed Aug 01, 2007 4:47 pm
by Coffeymate
Only thing I could think of to help with this particular issue would be to create a different template used only for your RSS feed page and put in the meta tag nocache element into the code in the header.

Re: Remove caching for one page????

Posted: Wed Aug 01, 2007 6:39 pm
by ircmaxell
What caching are you talking about?  The core cache?  or a 3pd caching component?  If it's the core cache, there is a way, but it involves hacking the core (not too hard)...

Re: Remove caching for one page????

Posted: Wed Aug 01, 2007 7:59 pm
by mickscool
Thanks Friends,
Yeah, i am talking of the core cache,the one you set under "global configuration -> cache" settings. Can you please share that hack ,I would appreciate that.

Installing a separate theme would be a hard solution i guess...

Thanks

Re: Remove caching for one page????

Posted: Wed Aug 01, 2007 8:41 pm
by ircmaxell
Now, this is going back some, but if memory serves correct, you can do it like this...

edit /includes/Cache/Cache.php
You'll see "function save($data..."
change

Code: Select all

        function save($data, $id = NULL, $group = 'default')
        {
                if ($this->_caching) {
To

Code: Select all

        function save($data, $id = NULL, $group = 'default')
        {
               if(strpos($data,'<!--nocache-->') !== false) {
                     $this->_caching = 0;
               }
                if ($this->_caching ) { 
then, create a module with "" in the body, and publish it to any displayed position (Users won't see it)... Then just enable that module on any page you don't want cached...

Re: Remove caching for one page????

Posted: Wed Aug 01, 2007 10:23 pm
by mickscool
Cool solution..thanks a lot.. realli realli appreciate it...