Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1218

Serializibility of HttpCacheEntry and BufferedHeader

    XMLWordPrintableJSON

Details

    Description

      Current serialization of HttpCacheEntry relies on java.io.Serializable. But not everybody wants to rely on this RPC format, since there are better alternatives -> Kryo for example. I tested it: once the class is registered in Kryo, serialization is 10 times faster and takes up 4 times less bytes.

      Instances of BufferedHeader (which implements FormattedHeader) in the header group are not serialization friendly: Factory is slow and lot's of memory is wasted to generate parsers.
      A header is a plain POJO with a name and a value, nothing more. I'm not quite sure of the point of the FormattedHeader interface.

      • Quick fix is replacing all BufferedHeader with BasicHeader instances before serializing.
      • Long term idea suggestion: If the API wants to keep FormattedHeader would it be possible to allow the API user to disable it?

      Attachments

        1. httpCacheEntry.patch
          1 kB
          Alexis

        Activity

          People

            Unassigned Unassigned
            alexis779 Alexis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: