PDA

View Full Version : Disable post cache on post with custom bbcode?


krrose27
03-25-2011, 11:29 PM
Hi (first post, yay?).

I am working on trying to integrate content pulled from a curl reqest in to a form post..

What I have works great up to the point that it is cached...

I like the builtin post cache but posts that use this custom bbcode should not be cached for more then an hour...

So here are my questions:

1) Is their a way to set a post-cache expatriation time?

If not

2) Can we just disable the cache on posts that use his vb? (handle caching ourselves db inside the create below)?

If not

3) Any ideas to do what we are trying todo right now?


$custom_bbcode = 'sppb';

$this->tag_list['no_option'][$custom_bbcode] = array ();
$this->tag_list['no_option'][$custom_bbcode]['callback'] = 'handle_external';
$this->tag_list['no_option'][$custom_bbcode]['external_callback'] = 'handle_my_custom_bbcode';

if (!function_exists ('handle_my_custom_bbcode')) {
function handle_my_custom_bbcode (&$theobj, &$value, &$option) {
$ctx = stream_context_create(array('http' => array('timeout' => 20)));
$content = file_get_contents('http://somsite.com/product/forum/'.$value, 0, $ctx);
if(!empty($content)){
return print_r(unserialize(base64_decode($content)), true);
} else {
return 'WE FAIL!';
}
}
}