Skip to content

fix(SiteSearch): URL-mapped content renders same HTML for all contentlets due to page cache collision#34879

Merged
dsilvam merged 1 commit intomainfrom
issue-34130-fix-title-site-search-indexes
Mar 13, 2026
Merged

fix(SiteSearch): URL-mapped content renders same HTML for all contentlets due to page cache collision#34879
dsilvam merged 1 commit intomainfrom
issue-34130-fix-title-site-search-indexes

Conversation

@dsolistorres
Copy link
Copy Markdown
Member

@dsolistorres dsolistorres commented Mar 5, 2026

Closes #34130

Proposed Changes

  • Set WebKeys.WIKI_CONTENTLET_INODE in HTMLPageAssetAPIImpl.getHTML() method. VelocityLiveMode.buildCacheParameters() reads WIKI_CONTENTLET_INODE as a component of the page cache key. Since it was always null, every URL-mapped contentlet of the same content type produced an identical cache key — so the first contentlet's rendered page was cached and returned for all subsequent ones. With the fix in place, the page cache key is unique per contentlet, so there are not cache collision for different URL mapped items.
  • A new test method urlMapGeneratesDifferentHTMLPerContentlet has been added to URLMapBundlerTest class. The test that creates two URL-mapped contentlets with distinct field values, runs the bundler, and asserts each generated HTML file contains its own unique value.

Checklist

  • Tests

This PR fixes: #34130

…ache collision for URL-mapped content (#34130)

HTMLPageAssetAPIImpl.getHTML() never set WIKI_CONTENTLET_INODE, causing
VelocityLiveMode to build identical cache keys for all contentlets of the
same URL map content type — returning the first rendered HTML for all.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dsilvam dsilvam added this pull request to the merge queue Mar 13, 2026
Merged via the queue into main with commit 64e21da Mar 13, 2026
43 checks passed
@dsilvam dsilvam deleted the issue-34130-fix-title-site-search-indexes branch March 13, 2026 17:08
spbolton pushed a commit that referenced this pull request Mar 24, 2026
…lets due to page cache collision (#34879)

Closes #34130

### Proposed Changes
* Set `WebKeys.WIKI_CONTENTLET_INODE` in
`HTMLPageAssetAPIImpl.getHTML()` method.
`VelocityLiveMode.buildCacheParameters()` reads `WIKI_CONTENTLET_INODE`
as a component of the page cache key. Since it was always null, every
URL-mapped contentlet of the same content type produced an identical
cache key — so the first contentlet's rendered page was cached and
returned for all subsequent ones. With the fix in place, the page cache
key is unique per contentlet, so there are not cache collision for
different URL mapped items.
* A new test method `urlMapGeneratesDifferentHTMLPerContentlet` has been
added to `URLMapBundlerTest` class. The test that creates two URL-mapped
contentlets with distinct field values, runs the bundler, and asserts
each generated HTML file contains its own unique value.

### Checklist
- [x] Tests

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area : Backend PR changes Java/Maven backend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[DEFECT] Incorrect and repeated titles for Site Search results [Url Mapped Content]

3 participants