Go Back   Pligg CMS Forum > Pligg Help > Customization Assistance

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-17-2007, 08:26 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 575
Thanks: 14
Thanked 126 Times in 61 Posts
Enabling Caching for Categories?

Ok, i see that experimental caching is enabled in config.php, and i believe that it is currently only being used on the categories module for digitalnature. I just transferred the template code to the yget sidebar.tpl file. Are any cached files supposed to appear in the cache directory, because nothing appeared for me. Or is there something else that is required in the base php files?

The code i'm referring to is in sidebar.tpl:
Code:
{if $cat_array neq ""}
{assign var=sidebar_module value="categories"}
{assign var=sidebar_module_cache value="true"}
{assign var=sidebar_module_cache_id value="sidebar|category|".$templatelite.get.category}
{assign var=sidebar_module_cache_lifetime value="-1"}
{include file=$the_template_sidebar_modules."/wrapper.tpl"}
{assign var=sidebar_module_cache value="false"}
{/if}
__________________

Reply With Quote
  #2 (permalink)  
Old 03-18-2007, 01:29 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 575
Thanks: 14
Thanked 126 Times in 61 Posts
I did some more rooting around, and discovered the do_sidebar() function in libs/html1.php

Code:
function do_sidebar($var_smarty) {
    global $db, $dblang, $globals;

    $_caching = $var_smarty->cache;     // get the current cache settings
    $var_smarty->cache = true;             // cache has to be on otherwise is_cached will always be false
    $var_smarty->cache_lifetime = -1;   // lifetime has to be set to something otherwise is_cached will always be false
    $thetpl = $var_smarty->get_template_vars('the_template_sidebar_modules') . '/categories.tpl';

    if(isset($_REQUEST['category'])){
        $thecat = $_REQUEST['category'];
    }else{
        $thecat = '';
    }
    if ($var_smarty->is_cached($thetpl, 'sidebar|category|'.$thecat)) {
        //echo 'Cached';
        $var_smarty->assign('cat_array', 'x');
    }else{
        //echo 'Uncached';
        //Uncached Code continues below....
    }
I added the echoes above to see if the cached or uncached version was being used, and found the uncached version was still being used, even with the cache addition in sidebar.tpl - i'm guessing something still needs to be added or turned on, but i have no idea what. :p
__________________

Reply With Quote
  #3 (permalink)  
Old 04-23-2008, 02:01 PM
New Pligger
 
Join Date: Apr 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
smarty never write in the cache the categories, so in the second load can not locate it
Reply With Quote
  #4 (permalink)  
Old 04-24-2008, 11:15 AM
New Pligger
 
Join Date: Apr 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
There would two types of cache.

1. Smarty cache.
2. Final Page cache.

Smarty does the template caching. However, I am more interested in having the cache implemented such that it would serve the same rendered page for a given period of time. On a busy site, one could cache the page for say 15 seconds, where as on not so busy site, it could be 1 hour or more. I am looking such implementation but haven't found a solid answer yet. Are the Pligg Gurus working on this?
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Caching on Pligg. observer_24_7 General Help 0 08-24-2007 07:06 PM
caching ... questions. observer_24_7 General Help 18 03-29-2007 06:33 PM
issue/idea? enabling GZip kills PrivateMessages in Safari daveyc Modification Tutorials 4 03-25-2007 12:27 AM
Updating avatar - caching problem? revolver General Help 6 03-12-2007 09:46 AM


Search Engine Friendly URLs by vBSEO 3.2.0