Updating Response header after commit state | Community
Skip to main content
Level 2
June 25, 2022
Solved

Updating Response header after commit state

  • June 25, 2022
  • 1 reply
  • 928 views

Hi team,

 

I'm basically looking to achieve some response header modification (e.g. "location" for redirect patterns etc.) But the problem is stated below.

1.  Maximum response buffer size is set as 150 KB; But header section at few pages are writing more content in response which is causing the response to get committed in earlier state before component 1 is chained.

2. So, now if I need to update response headers based on certain result from component 1's REST call (to some remote platform); I'm unable to perform as the response is already committed and no further byte codes will be entertained.

 

So I'm trying to explore if there's any way this situation can be handled. Any help would be really great! 🙂 Thanks!!

 

N.B. -  Some workarounds being tried:

1.  Chained filter in header component scope and try to execute component 1 logic there itself. But this does not seem so standard as i) additional REST call  ii) If trying to avoid extra REST call, then component 1 logic will be executed from Header scope, which is not good.

2. Increase Response buffer size, but that would negatively impact memory load (due to socket consumption)

3. Trying to reduce some redundant element from header but not sure if that'd always keep the resource size within the limit of buffer size.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

No, this is not possible. When the response is flushed for the first time, it will send the HTTP response header first to the client. And this cannot be undone.

 

If you need to have this behavior, split your single request into multiple ones.

1 reply

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
June 25, 2022

No, this is not possible. When the response is flushed for the first time, it will send the HTTP response header first to the client. And this cannot be undone.

 

If you need to have this behavior, split your single request into multiple ones.