Fork me on GitHub

Caching problems  Bottom

  • Like, apparently, a good many in this particular corner of the Postnuke forums, I am having a crack at teaching myself how to develop a module by slogging my way through the Example files (my understanding is that this is the recommended learning process, and I have also gotten the notion from somewhere that the Example templates are more suitable than the Template templates for a module in a pnRender/Xanthia context - I could always have the wrong end of the stick, here). And I come across what has always been my biggest Postnuke headache - caches.

    I am using a Xanthia theme (pnDefault-based). So I deactivate Xanthia caching and make some changes to my module - let's call it pnFirst (it is not very relevant, but my immediate objective is to get new variables to display - for the moment, I can input but not output). After I have fiddled around for a while, it becomes clear that the changes to pnFirst are not being reflected on screen. Dang. Just to make sure, in lang/eng/admin.php, I change a language constant for the "admin_modify" template. The constant is '_TESTINGEDIT,' in English normally "Edit this item," and I alter it to read something whimsical like "Sod this for a lark." I go back to the Xanthia configuration menu and make sure "Check for updated version of templates" and "Force templates recompilation" are checked and "Store templates in database" is not. I still see "Edit this item" instead of "Sod this for a lark." Double dang. I use phpMyAdmin to check that there are no template-like things being stored in the database, and if there are, I can't recognise them as such. I meander aimlessly around the forum for a while, and am reminded that pnRender does its own caching, so I make sure it is disabled, and also click "Delete cached pages." I still see "Edit this item" instead of "Sod this for a lark," inexplicably even when I change the theme to ExtraLite. I take a look at the contents of pnTemp and delete almost everything in sight. Viciously. I still see "Edit this item" instead of "Sod this for a lark," but am coming round to the latter opinion.

    Now, if I work on the module on a test version of the site (where I have already seen "Sod this for a lark" and changed it back again), with pnRender and Xanthia deactivated or removed, I avoid the caching problem altogether, but it doesn't seem the best way to go if the end idea is for pnFirst to work with a Xanthia theme. So where is the cache or caches and how do I turn it/them off?
  • This might help you.

    $pnRender->caching=false;

    you can set that for a particular function to no have it cache. There is another line the actual template files, but i dont know it off the top of my head.
  • I think it's the same, $pnRender->caching = false - it repeats five times in the pnadmin.php template, once for each function.
  • I use sysv shared memory caching and it works wonderful. Just add a little code to my index.php file, and it works wonders on my site. http://www.adamstevenson.net/mycached.phps
    Just add this code right after
    pnInit();
    at the top of index.php, and download mycached.php

    if(!pnUserLoggedIn()){
    include 'mycached.php';
    do_cache();
    }
  • link doesnt seem to work adam
  • 0 users

This list is based on users active over the last 60 minutes.