Skip to content

Conversation

@DeviaVir
Copy link
Contributor

HEAD /nojs/address/... took 2530ms and returned 878259 bytes

This proves HEAD requests are generating the full HTML body (878KB) and taking 2.5 seconds - the same expensive operation as GET requests.

The code confirms this: in server.js, every request (HEAD or GET) calls render(), which runs the full Cycle.js app to generate HTML. Express handles HEAD by not sending the body, but the work is still done.

The proxy uses HEAD requests to check if pages exist (200 vs 404/500), not to get content-length. The prerender determines status codes without needing the full HTML body.

@DeviaVir DeviaVir requested a review from Copilot September 22, 2025 15:30
@DeviaVir DeviaVir self-assigned this Sep 22, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes HEAD request handling in the prerenderer to avoid unnecessary full HTML generation. HEAD requests are currently performing the same expensive rendering operations as GET requests (taking 2.5 seconds and generating 878KB of HTML) when they only need to determine status codes.

  • Passes isHead flag through the rendering pipeline to identify HEAD requests
  • Returns empty HTML content for HEAD requests while preserving status code determination
  • Updates client symlink from src to dist directory

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
prerender-server/src/server.js Adds isHead flag to render call options to identify HEAD requests
prerender-server/client Updates symlink to point to dist instead of src directory
client/src/run-server.js Returns empty HTML for HEAD requests while preserving status code logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@DeviaVir DeviaVir force-pushed the prerenderer-head-patch branch from bd5dacb to eb1ba8c Compare September 22, 2025 15:33
@DeviaVir DeviaVir requested a review from Copilot September 22, 2025 15:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@DeviaVir DeviaVir merged commit 54a8453 into master Sep 23, 2025
3 checks passed
@DeviaVir DeviaVir deleted the prerenderer-head-patch branch September 23, 2025 08:22
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

Successfully merging this pull request may close these issues.

4 participants