Sitebase

Sitebase does not currently provide support for this item.

69 comments found.

Is it possible to cache a database query?

Hi there,

I’m receiving the following error:

PHP Catchable fatal error: Object of class FileMaker_Result could not be converted to string

any ideas?

Cheers.

I’ve been using this for a while now and it’s a great little caching system. 1 tweak I have made that others might find useful is to the read() function. The problem I had with it was that it was only checking that the file existed before it started reading, but if the file was EMPTY it would throw a warning about the length of the file needing to be greater than 0 to read (basically, their needs to be something in the file for it to read it). So I changed the function to check that the file size was greater than 0 (i.e. NOT EMPTY ) before attempting to read;

(function is around line 240 in the class file).

private function read($filename, $serialize=TRUE){
    $filesize = filesize($filename);
    if( (file_exists($filename)) && ($filesize>0) ){
        $handle = fopen($filename, "r");
        $content = fread($handle, $filesize);
        fclose($handle);
        return ($serialize == TRUE) ? unserialize($content) : $content;
    } 
    else { 
        return FALSE; 
    }
}

Hopefully this will help anyone else receiving the parameter must be greater than 0 warning.

This Author is no longer around.

Hi,

How do i implement the files and the system to my current cms?

I didn’t understand the documentation..

Looks like the author isn’t around anymore and the preview doesn’t show an improvement in speed…

Caching Disabled:
The script took 1370 miliseconds to execute.
Caching Enabled:
The script took 1713 miliseconds to execute.

So, it’s faster to just have the script disabled? This doesn’t look good…

The preview has errors and no longer works…

The demo has errors and no longer works…

supported this also browsercaching

by
by
by
by
by
by