@Andy Kelly: Hi Andy, I’m happy to hear that CE Cache has helped you. CE Cache still works great, and it has not been abandoned. It just doesn’t work with the native template layouts at this point. There are several other ways to use template layouts though. I’m happy to see that EL is anxious to get CE Cache and native layouts to play well together. This thread was marked as Resolved (eg: answered), before the last few people chimed in.
@EllisLab (I presume this is Derek Jones I’m talking to?) Thanks for following up with this! I already explained a bit of the problem in our email thread when I contacted you guys about this issue, but I didn’t answer your follow-up email question about whether or not CE Cache can parse snippets.
I’ve been waiting for some time to run a ton of tests, figure out which changes need to be made to core, and send over a pull request, but I apparently live from one deadline to the next and haven’t gotten around to tackle this subject. I’m just going to post my understanding of the problem in this thread.
Does CE Cache have the same problem with other things parsed prior to tags? Snippets, etc.?
Not particularly, because the CE Cache tags can still wrap all of the content between them. CE Cache does some wizardry with the read-only template_fetch_template hook in order to “pre-escape” some global variables, but for the most part, CE Cache is just grabbing the tagdata that is being passed in.
Using CE Cache around the entire template for a layout page wouldn’t work (even if exp tags could show up before a {layout=...} tag), because the {layout=...} and {layout:set} tags have already been processed by the time the CE Cache tag runs. The template class is on it’s way to parsing content and piping it to the next template.
I think the root of the problem is what I said in a previous email: that the layouts are parsed before exp tags, so there is not really a way for CE Cache to get in there before they’re processed. Most every tag in EE is processed by the parser when it is reached, which has traditionally allowed CE Cache to work. However, the layouts tag seems to be parsed beforehand. When I was testing this a few months ago, there wasn’t even a way to see which layout was being used with the template_fetch_template hook when dumping the EE super object; the layouts tag was already stripped out.
In order for the two add-ons to play well, CE Cache would need to be able to have an entry point to the content before the parser was already doing the heavy lifting. It would need to be able to intercept the template content (and/or parts of it) before it’s processed, and decide whether or not to serve up previously cached content, or to process the template content and then cache it. That’s how everything worked for a long time.
Does that make sense?
|