Problem/Motivation

The same problem as already described in #3253880: Caching not properly working when using Tokens in Views also persists for the mustache_views sub-module.

Steps to reproduce

Proposed resolution

Two workarounds to prevent caching conflicts:

  • Disable caching for the View (click on Caching: within Views UI display config and choose "None")
  • Add a contextual filter that would then automatically include the cache context beforehand. For example when using the node coming from the URL, then you need to add a contextual filter for it. You can do so by choosing "Global: Null" within contextual filters,
    and then select "Provide a default value" -> "Content ID from URL".

The Context Stack module might be able to solve this situation in the future by introducing cache contexts for entities. Related issue: #3253876: Provide cache contexts for entities and other objects

Remaining tasks

Find a proper solution path and fix the bug.

User interface changes

API changes

Data model changes

Comments

mxh created an issue. See original summary.

mxh’s picture

Issue summary: View changes

  • mxh committed ff16dd6 on 2.0.x
    Issue #3253881 by mxh: mustache_views: Caching not properly working when...
mxh’s picture

Status: Active » Needs work

  • mxh committed a986b31 on 2.0.x
    Issue #3253881 by mxh: mustache_views: Caching not properly working when...
mxh’s picture

A lot of optimization work was done and is available in the latest beta release. When using one of the workaround variants as described above, you should be good to go. Nevertheless, this issue remains on Needs work in order to try a more elegant solution path. Maybe there is a way to attache the cacheability metadata beforehand somehow.

mxh’s picture

Status: Needs work » Closed (outdated)