Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache issue when using "abstract" partials #257

Closed
lperrin opened this issue Sep 14, 2012 · 1 comment
Closed

Cache issue when using "abstract" partials #257

lperrin opened this issue Sep 14, 2012 · 1 comment

Comments

@lperrin
Copy link

lperrin commented Sep 14, 2012

I'm using partials to render a tab pane:

<div id="my-tab" class="tab-content">
  <div class="tab-pane active">
    {{> tab1}}
  </div>
  <div class="tab-pane">
    {{> tab2}}
  </div>
</div>

Now, if I do:

$('#my-tab').mustache({}, {
  tab1: '<p>Tab 1 - version A</p>',
  tab2: '<p>Tab 2 - version A</p>'
});

And then later:

$('#my-tab').mustache({}, {
  tab1: '<p>Tab 1 - version B</p>',
  tab2: '<p>Tab 2 - version B</p>'
});

I still get version A because the template has been cached. If that's not a proper use of mustache, it should be explained in the doc because this behaviour wasn't obvious to me until I read the code.

A fix would be to include partials in the key definition of the cache.

@mikelehen
Copy link

We are hitting the same issue I believe. Worked fine in 0.6.0, but in 0.7.0, I seem to be getting the same cached content each time.

prathe added a commit to prathe/punch that referenced this issue Sep 27, 2012
which is related to janl/mustache.js#257. Thanks to @jbourassa for
digging this.
laktek added a commit to laktek/punch that referenced this issue Sep 27, 2012
Restrict mustache version. Fix #25 which is related to janl/mustache.js#257. Thanks to @jbourassa for digging this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants