[pLog-svn] {dynamic} tags and plugins
Oscar Renalias
oscar at renalias.net
Wed May 2 16:33:03 EDT 2007
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
>
More information about the pLog-svn
mailing list