SOLVED: Query Loop Cache not compatible with Polylang (multilingual)

Browser: Chrome 110
OS: macOS / Windows / Linux / etc.

  • Cache Query Loops enabled + Polylang = wrong language terms/posts served from cache

  • Root cause: cache key in query.php line 246 is md5("brx_query_{element_id}_{query_vars}_{parent_object_id}") — language is not part of the key because Polylang filters queries inside WP_Query/WP_Term_Query via hooks (parse_query, get_terms_args), which run AFTER the cache key is computed

  • Problem is worse with persistent object cache (Redis/Memcached) where TTL can be much longer than 60s

Suggestion: add a filter like bricks/query/cache_key so developers can extend the key, or automatically include pll_current_language() / get_locale() in the cache key.

Thanks for pointing that out.

We will work on it. Added to the bug tracker.

Regards,
Jenn

We’ve addressed this in Bricks 2.3.2, now available as a one-click update in your WordPress Dashboard.

Please read the changelog entry before updating, and let us know if you experience any issues.

1 Like