Found the charset specific one at ...

Section 3.4 Character Sets - of RFC2616
http://tools.ietf.org/html/rfc2616#section-3.4

    HTTP character sets are identified by case-insensitive tokens.


How this string reuse works ...


The headers are accessed via a HttpField
<https://github.com/eclipse/jetty.project/blob/master/jetty-http/src/main/java/org/eclipse/jetty/http/HttpField.java>
object internally, that has 2 global caches based on Trie (a general
cache for field names and values, and another for content type charset
combos).


The caches are prepopulated with the 95% percentile of commonly used
values seen in web exchanges. (a quick glance at our list, I see that
the we came up with here is remarkably similar to the standardized
lists that the SPDY expert group also came up with for their own
optimization reasons.  I expect we'll see a similar list in HTTP/2 as
well)


During parsing or generating, the logical field is eventually
represented by a HttpField object, with the underlying Trie caches
eliminating the need for more String objects just to represent the
same content over and over again.  New strings not in the cache, are
added to the cache so that later HttpField instances can benefit from
this memory savings.



--
Joakim Erdfelt <[email protected]>
webtide.com <http://www.webtide.com/> - intalio.com/jetty
Expert advice, services and support from from the Jetty & CometD experts
eclipse.org/jetty - cometd.org


On Thu, Oct 17, 2013 at 6:38 AM, Joakim Erdfelt <[email protected]> wrote:

> With servlet STRICT, at least 2 String objects per header line. (more for
> multi-value header lines)
>
> AFAIK, the reused header strings are still strict in the sense of HTTP,
> but not strict in the sense of servlet spec.
>
>
> --
> Joakim Erdfelt <[email protected]>
> webtide.com <http://www.webtide.com/> - intalio.com/jetty
> Expert advice, services and support from from the Jetty & CometD experts
> eclipse.org/jetty - cometd.org
>
>
> On Thu, Oct 17, 2013 at 6:26 AM, Ben Summers <[email protected]> wrote:
>
>>
>> On 17 Oct 2013, at 06:23, Joakim Erdfelt <[email protected]> wrote:
>>
>> >
>> > Looks like a org.eclipse.jetty.http.HttpGenerator.STRICT property would
>> be
>> > the equivalent one for the response headers.
>> >
>> > Know that strict behavior will increase memory usage.
>> > Essentially with strict usage, no string portions can be reused, making
>> > every request (and now response) effectively churn the GC for no good
>> > reason.
>>
>>
>> Approximately how many objects would this create per request?
>>
>> It doesn't feel quite right that the web server is rewriting the headers
>> on the responses.
>>
>> Thanks!
>>
>> Ben
>>
>>
>>
>> --
>> http://bens.me.uk
>>
>> _______________________________________________
>> jetty-users mailing list
>> [email protected]
>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>
>
>
_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to