[pLog-svn] {dynamic} tags and plugins

Jon Daley plogworld at jon.limedaley.com
Wed May 2 17:34:01 EDT 2007


 	Yes, I agree, except that the plugins like blogstatistics, 
authentication and google haven't worked since we added the template 
cache, so we did lose useful functionality.
 	Authentication has now been implemented in the core, but I like 
both the blogstatistics and google plugins, and wish there was a way to 
make it work.
 	Using the {insert} tag would be an acceptable solution to me, and 
it might be possible to get that to work both to optimize the load for 
cached pages, and only incur the overhead was processing the extra 
inserted templates.


On Wed, 2 May 2007, Oscar Renalias wrote:

> Well yeah it's not that getting plugins to run within cached pages
> was technically impossible... With a little bit of code here and
> there everything's possible :) But we never really had a need to get
> plugins to run in a cached pages, or else we're kind of defeating the
> point of caching. If there's something that we're not able to cache,
> we're still incurring in some extra overhead, as Smarty needs to
> process and render a small bit of a template.
>
> We can of course make the changes to get around this limitation but I
> see two issues:
>
> 1) we wouldn't be able to do it before 1.3, because we shouldn't
> break/change the standard behaviour of plugins and the whole plugin
> framework this late into the 1.2.x branch.
>
> 2) and most important, I have been thinking about ways to optimize
> cached pages even more. Right now we still need to load the whole
> framework in order to display a page that has already been generated
> and for which we don't need any extra classes or processing: we just
> need to load the cached version from disk and push it to the client.
> Ideally all we would need to do is come up with a way to quickly
> identify if a page is cached (maybe we can use a hash of the URL?)
> and quickly send it back to the client, but I need to have a closer
> look at the code and see if this is even feasible to do...
>
> Number 2 obviously means that plugins wouldn't work in cached pages
> and this time there wouldn't even a workaround available.
>
> On 2 May 2007, at 17:26, Jon Daley wrote:
>
>> http://bugs.lifetype.net/view.php?id=293
>>
>> We have talked about this a long time ago, and came up with the
>> conclusion
>> that plugins can't work inside the {dynamic} tag. It turns out that
>> isn't
>> really true.
>>
>> The problem is in class/view/blogview.class.php, where a bunch of
>> template
>> objects are only included if the template isn't cached.  If you
>> move the
>> plugin for loop (or the $now) code, those variables are available
>> inside a
>> {dynamic} tag.
>>
>> However, since that increases the RAM used for cached pages, we
>> don't want
>> to just put everything outside the if(!cached) block.
>>
>> I was wondering about either letting the plugins decide themselves
>> if they
>> should be loaded or not, or check the template to see if there is a
>> {dynamic} tag or have an administration preference that says "Allow
>> plugins inside dynamic tags.  I am not sure what would be the
>> easiest or
>> best.  Any thoughts?
>>
>> I see now that for the plugins the objects are already loaded even
>> in a
>> cached view (I think) but the call to PluginManager->getPlugins calls
>> register() for each plugin in the non-cached view as opposed to the
>> cached
>> view.  Maybe that overhead isn't that much?
>>
>>
>> _______________________________________________
>> pLog-svn mailing list
>> pLog-svn at devel.lifetype.net
>> http://limedaley.com/mailman/listinfo/plog-svn
>>
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
>

-- 
Jon Daley
http://jon.limedaley.com/

If animals weren't created to be eaten,
   why are they made out of meat?!


More information about the pLog-svn mailing list