dagd icon indicating copy to clipboard operation
dagd copied to clipboard

`DaGdResponse` calls `getBody()` twice causing `DaGdHTMLResponse` to render the HTML AST twice

Open relrod opened this issue 7 months ago • 0 comments

DaGdReponse calls getBody() both to calculate the content-length header and to render the actual AST and echo it out.

Both times, in the case of DaGdHTMLResponse this means we build up the AST twice (and any side effects that happen e.g. in implementations of DaGdToTagInterface#toTag get called twice because of it).

This is less than ideal both from a performance standpoint (rendering the AST out can be expensive) and from a "why is toTag() getting called twice??" perspective.

relrod avatar May 13 '25 10:05 relrod