I'm having a hard time wrapping my head around this.

I'm using Stash template partials approach, with the needle/haystack technique for replacing variables in content blocks... with CE Cache over the top.

My template looks like this:

{!-- Embed view/layout --}

{exp:ce_cache:it id="model"}

  {exp:channel:entries ...}
    {!-- Get video data from matrix field --}
      {exp:stash:set name="video-{row_count}" type="snippet"}

    {!-- Vars to go in view/layout --}


        {!-- Parse this so the {video-1}, {video-2} snippets within will work --}



My view/layout template looks like this:

{exp:ce_cache:it id="view"}



Everything works just fine when CE Cache is disabled.
When I enable it, the 'view' cache fragment shows something like:

<h1>Page Title</h1>
<p>This is the page content</p>
<p>Some more content</p>

If I change {exp:stash:parse} to {exp:stash:parse process="end"}, then the 'view' cache fragment will look something like:

<h1>Page Title</h1>

I don't know what I need to escape or modify to get this working.
Any suggestions would be appreciated!

The latest version of CE Cache has some Stash-related improvements.
Updating fixed the issue but introduces a Stash bug.
Also, I need to use {exp:stash:parse process="end"}.

I get a PHP error on the first page load, but everything seems to get cached correctly and the subsequent page loads are perfect.
I've taken this up with Mark and will post an update later.

Update 2:
Aaron (CausingEffect) has fixed the issues in the latest version of CE Cache.
The above code works perfectly - provided you use {exp:stash:parse process="end"}.

  • 1
    That looks like a lot of caching! :) Why are you using both CE Cache and Stash however? I can imagine that the two together with one inside the other would cause a few problems.
    – Ian Young
    Apr 17, 2013 at 19:41
  • I'm not using Stash caching, though. Just using Stash for the template partials approach. Apr 17, 2013 at 20:13
  • I suspect you need to escape out of CE Cache on at least those parts of the page. The weird gibberish is a placeholder string that the EE template parser uses when it's partway through its run.
    – adrienne
    Apr 17, 2013 at 20:42
  • Adrienne, take a look at the update at the end of the post. Latest version of CE Cache gets most of the way there. Apr 17, 2013 at 21:48
  • Interesting. I've not considered using the two in combination before but potentially it could be quite a powerful combination. It looks like Aaron (CE) may be looking to add a plugin to allow escaping by default in combination with Stash which also looks promising. Let me know what you hear back from Mark.
    – Ian Young
    Apr 18, 2013 at 9:35

2 Answers 2


I set up my templates differently from you with regards to CE Cache. I wrap the whole template in CE Cache tags so that includes the embedded layout template too.

Page template

{exp:ce_cache:it id="the-template"}
...rest of page...

and then don't wrap the layouts/index template in CE Cache tags but instead use escape tags for bits I don't want cached.

  • The latest version of CE Cache fixes the issues I bring up in my question. Apr 18, 2013 at 13:15

This issue is fixed by updating CE Cache to the latest version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.