Categories > TinyButStrong general >

cache

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: silang
Date: 2003-10-17
Time: 11:34

cache

I am having trouble with using the cache - the page i want to cache changes ie <td colspan="6">[tbs_check.1;block=table;if [var.block]=1]</td> etc depending on variables sent via $_get.  Is it possible to cache the various results?

Many thanks.
By: Skrol29
Date: 2003-10-19
Time: 00:21

Re: cache

Hello Silang,

If I understand, you'd like to cache a template wich is not completly merged.
I think this is possible.
Try something like this:

$TBS->Render = TBS_NOTHING ;
$cached = $TBS->CacheAction('main.cch',3600) ;
if (!$cached) {
  // Here you code that does the part that should be cached
  ...
  //Save the result in the cache
  $TBS->CacheAction('main.cch',TBS_CACHENOW) ;
}
// Here you code that does the part that should not be cached
...
//Display the result
$TBS->Render = TBS_OUTPUT + TBS_EXIT ;
$TBS->Show() ;