Page 1 of 1

Tuffclassified theme running slow

Posted: Mon Aug 08, 2016 10:30 am
Initially it was all good. On the apache server is set all ok ...

It seems that this theme works very slowly compared to other OSclass theme
(Slow it all (admin panel opens difficult as the site and all pages).


I do not know why. Would you be able to be due to caching option?


How can disable caching> oc-content / themes / tuffclassified / cache?

Re: Tuffclassified theme running slow

Posted: Mon Aug 08, 2016 5:21 pm
by steve
It's strange that tuffclassified is working slower than other themes for you. What other themes have you tried?

Caching is something that will help you speed up the website instead of slowing it down, so im sure you don't want to remove the caching functions.
By any chance are you using a free hosting?

Regards,

Re: Tuffclassified theme running slow

Posted: Mon Aug 08, 2016 5:53 pm
by tuffadmin
It may happen on webhost who use slow disk. And because we cache preferences too, it may slow down(Random thought) on some server.
Change these two function in the beginning of core-functions.php file

Code: Select all

/************************************************************\
*Function to get Tuffclassified Prefrences
\************************************************************/
function tfc_getpref($pref) {
    //get preference of theme
    $tfccache = new tfcFileCache();
    //global $tfccache;
    $key = $pref;
    // check if the data is not in the cache already
    if (!$data = $tfccache->tfcfetch($key)) {
        // there was no cache version, we are fetching fresh data
        $data = osc_get_preference($pref, 'tuffclassified_theme');
    }
    // Storing the data in the cache for 10 minutes
    $tfccache->tfcstore($key,$data,600);
    return $data;
}

/************************************************************\
*Function to set Tuffclassified Prefrences
\************************************************************/
function tfc_setpref($pref,$param){
    //set preference of theme
    $key = $pref;
    $data = $param;
    $tfccache = new tfcFileCache();
    $tfccache->tfcstore($key,$data,600);
    return osc_set_preference($pref, $param, 'tuffclassified_theme');
}
Into this

Code: Select all

/************************************************************\
*Function to get TuffClassified Prefrences
\************************************************************/
function tfc_getpref($pref) {
    //get preference of theme
        $data = osc_get_preference($pref, 'tuffclassified_theme');
    return $data;
}

/************************************************************\
*Function to set TuffClassified Prefrences
\************************************************************/
function tfc_setpref($pref,$param){
    //set preference of theme
    return osc_set_preference($pref, $param, 'tuffclassified_theme');
}
Also share if this makes any improvement.

Re: Tuffclassified theme running slow

Posted: Mon Aug 08, 2016 8:35 pm
We did change the line of code in the core-functions.php file, and the effect is 100% Optional ;)

This change accelerates site! Improving the site loading speed is great.

Tnx !