Skip to content

Comments

Turns off Caching for JSON responses#680

Open
lucanos wants to merge 1 commit intoflightphp:masterfrom
lucanos:json-nocache
Open

Turns off Caching for JSON responses#680
lucanos wants to merge 1 commit intoflightphp:masterfrom
lucanos:json-nocache

Conversation

@lucanos
Copy link

@lucanos lucanos commented Feb 19, 2026

Adds headers to json response to avoid caching of the response

Adds headers to json response to avoid caching of the response
@craigrodway
Copy link

What's the rationale for having Flight set this as the default?

There are legitimate cases where developers may want to have a JSON response cached for all requests, or just for some requests and not others. I think these headers should be opt-in rather than a blanket default.

@n0nag0n
Copy link
Collaborator

n0nag0n commented Feb 20, 2026

So there's been some controversy around this area of code. What you've added will explicitly not require it to be cached, but also some other behaviors make it so it wouldn't cache even with this code not added in. I used to have it added in, but then there was something else (and it escapes me what it was) but something else was causing the caching behavior so I had it removed.

I'll need to do some thinking and testing with this guy once I get some time.

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.

3 participants