Skip to content

Remove the HTMX GET cache-buster query string - #4074

Open
reakaleek wants to merge 1 commit into
mainfrom
cursor/a2d1e65e
Open

reakaleek wants to merge 1 commit into
mainfrom
cursor/a2d1e65e

Conversation

@reakaleek

Copy link
Copy Markdown
Member

HTMX navigation no longer appends a builder-version ?v= query string. Request URLs match the page URL, and the same key no longer overwrites search's product-version filter.

Affects: Site UI, API reference, Codex builds

Prompt summary: Remove the HTMX GET ?v= cache-buster. It existed for out-of-band swap cache invalidation that no longer applies.

Why

HTMX GET requests append a builder-version v query string so caches do not serve stale HTML during out-of-band swaps. Navigation now uses hx-boost on #main-container. HTMX history is already off, and static assets already use a content hash. The same v key overwrites the product-version filter on full-page search.

What

HTMX request URLs

Boosted GET requests no longer receive a builder-version v parameter. History updates no longer strip that parameter. The request URL and the address bar stay aligned with the page URL.

Layout model

The layout no longer carries DocsBuilderVersion or data-docs-builder-version. Markdown, Codex, and API pages stop hashing the builder version into every view model.

Synthetics

The /docs/api journey still asserts a full page load through isNavigationRequest(). It no longer treats a missing v parameter as proof the click was not HTMX.

Verify

cd src/Elastic.Documentation.Site && npm run test && npm run compile:check
dotnet test tests/Navigation.Tests/
dotnet test tests/Elastic.ApiExplorer.Tests/

Out of scope: Search still uses ?v= for the product version. Static files still use ?v={contentHash}.

Made with Cursor

Builder-version `?v=` no longer keeps HTMX navigation fresh and overwrites search's product-version parameter.

Co-Authored-By: Cursor Grok 4.6 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

Docs preview (local build)

Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4074/

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes: this update removes DocsBuilderVersion from GlobalLayoutViewModel but leaves a remaining initializer in tests/Navigation.Tests/Rendering/FooterRenderingTests.cs, which breaks Navigation.Tests compilation with CS0117.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@@ -37,7 +37,6 @@ public record CodexBreadcrumb(string Title, string? Url);

public record GlobalLayoutViewModel
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] Removing DocsBuilderVersion leaves the test suite uncompilable

Deleting this property breaks at least one remaining object initializer that still sets it (tests/Navigation.Tests/Rendering/FooterRenderingTests.cs, DocsBuilderVersion = "test"). That causes CS0117 in Navigation.Tests, so this PR currently does not build for that test project.

Please remove the stale assignment(s) in tests (or keep a compatible property while all call sites are migrated).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant