PDA

View Full Version : Change the Cached Posts Lifespan to 0 if [code] in message


brfrankl
07-19-2007, 10:54 AM
Is there any way to only change the cached posts lifespan to 0 IF the post contains the [code] tag?

nexialys
07-19-2007, 11:06 AM
the lifespan is not related to the content of the posts but to the global setting of your board, for control and stability... having a per-post setting would be desastrous on serverload...

brfrankl
07-20-2007, 02:19 PM
I know, but I need cache load 0 only for posts that contain code, it can cache the others.

so the question is, is it less load for all to have cache 0 or for it to figure it out per post...

Andreas
07-21-2007, 06:51 PM
*** Untested ***

bbcode_fetch_tags

if (!function_exists('my_handle_bbcode_code'))
{
function my_handle_bbcode_code(&$parser, $code)
{
$parser->options['cachable'] = false;
return $parser->handle_bbcode_code($code);
}
}
$tag_list['no_option']['code']['callback'] = 'handle_external';
$tag_list['no_option']['code']['external_callback'] = 'my_handle_bbcode_code';

Semere79
10-06-2008, 03:14 AM
Actually is there a way to disable a post cache based on if it had a certain bbcode in it? Server load isn't a huge issue for me since I have my own dedi and I am not using all of it... However, I see the above I just don't understand where I would insert it to set it up to work with the bbcode we have in place...

Thanks for your help,
Semere