We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21255
    • 215 Posts
    IMO all these Template Service Events do not make much sense if a page is delivered from cache, because in that case the plugin has no chance of changing the documentObject. I propose to check if the Plugin has set documentGenerated to 1 before invoking checkCache. smiley

    // invoke OnWebPageInit event
         $this->invokeEvent("OnWebPageInit");
    // we now know the method and identifier, let's check the cache
         if($this->documentGenerated!=1) $this->documentContent = $this->checkCache($this->documentIdentifier);
    

    (document.parser.class.inc.php, line 1002)
      • 22303 MODX Staff
      • 10,725 Posts
      Great idea. I can see that as being very handy to allow a plugin to override caching on a document programmatically, forcing it to be re-generated from the DB.
        • 1764
        • 680 Posts
        Yes, definitely a good idea. Anybody want to get it in 0.9.2?
          • 22303 MODX Staff
          • 10,725 Posts
          If you all will check it in your branches, I’ll be glad to do a merge tonight into trunk. Just make sure you are testing against latest. To update latest changes from trunk to your branch and test as it will be merged, you can do a merge of trunk from the range of revisions up to HEAD since you created or last merged your branch from trunk. In fact, this will become a standard part of the commit process I want us to put together; how to become a core committer (aka a description of our meritocracy) and a core committers guide (aka developers guide).
            • 32963
            • 1,732 Posts
            Quote from: netnoise at Mar 25, 2006, 03:31 PM

            IMO all these Template Service Events do not make much sense if a page is delivered from cache, because in that case the plugin has no chance of changing the documentObject.

            Not sure I understand you here NetNoise. I’m sure the $modx->documentObject is recreated after loading the document cache. That’s not the case?
              xWisdom
              www.xwisdomhtml.com
              The fear of the Lord is the beginning of wisdom:
              MODx Co-Founder - Create and do more with less.
              • 21255
              • 215 Posts
              Quote from: xwisdom at Mar 27, 2006, 09:40 AM

              Not sure I understand you here NetNoise. I’m sure the $modx->documentObject is recreated after loading the document cache. That’s not the case?
              Hmm, thanks for that hint, you’re right, there would be a chance to modify the documentObject (regardless if cached or not) by listening to both, the OnLoadWebPageCache and the OnLoadWebDocument events. Still the modified Object won’t go back into cache...
              Well, I stick a bit with the idea of Plugins beeing able to force page regeneration wink