jetty.project icon indicating copy to clipboard operation
jetty.project copied to clipboard

Keep extracted query params as attribute for jetty-core

Open lachlan-roberts opened this issue 5 months ago • 2 comments
trafficstars

It feels like querry params would almost certainly have already been extracted at this point. Don't we store as an attribute or similar? Hmm apparently not... let's open another issue to investigate doing this in core (not just in servlet)

Originally posted by @gregw in https://github.com/jetty/jetty.project/pull/12877#discussion_r2141057460

lachlan-roberts avatar Jun 13 '25 05:06 lachlan-roberts

Careful, that Attribute would need to be aware of changes to the HttpURI query and be cleared out every time we create a new Request Wrapper to modify the HttpURI.

That technique is likely safest to do at the Servlet level, not at the core level.

joakime avatar Jun 13 '25 11:06 joakime

@joakime the servlet level already does it. But if we are to increasingly write core webapps, or if core is doing things like websocket upgrade, then it would be good to avoid parsing the query parameters again on each call. Perhaps we an have a check to see if the HttpURI has changed and if not, then we can use the cached query parameters.

gregw avatar Jun 16 '25 06:06 gregw

resolved by https://github.com/jetty/jetty.project/pull/13248

lachlan-roberts avatar Jun 26 '25 02:06 lachlan-roberts