내 커뮤니티 업적 표시줄을 확대합니다.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Updating Response header after commit state

Avatar

Level 2

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.

DJSarkar_0-1656146676951.png

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.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Employee Advisor

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 답변 개

Avatar

정확한 답변 작성자:
Employee Advisor

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.