CCaskIndex
Workflows

Coding workflows · Conditional HTTP cache requests

03
Built around your work

A concrete starting point

Return 304 for a matching validator on a GET request and send changed content normally. Check a missing header, a weak validator and a 304 response with no body using the project’s HTTP parser.

01

Open the context

Choose the project folder and name the files or behavior involved.

02

Define the change

Describe the input, expected output and boundaries that must stay intact.

03

Inspect the work

Review the proposed edits and any commands before relying on their result.

04

Check the outcome

Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.

Conditional HTTP cache requests

A concrete starting point
const unchanged = request.method === "GET" &&
  validatorMatches(request.headers.get("if-none-match"), etag);
return new Response(unchanged ? null : body, {
  status: unchanged ? 304 : 200,
  headers: { ETag: etag },
});

The example is a starting point for a real project, not a claim that generated code is already tested. Adjust paths, dependencies and expected behavior to match your application.

AI coding workspace

Your next change starts here.

Get the Windows app ↗