how to cache http requests at proxy server in java?
I am a student building a http proxy server. I want to cache those requests that ar开发者_如何学Goe frequently accessed. May I get any idea about this? Especially in java.
To figure out what you need to implement, read and understand the HTTP specification. Focus particularly on the sections on how a proxy is supposed to behave.
You could possibly base part of the implementation on the Apache HttpClient library, but I have a feeling that the APIs will prove to be unsuitable for the proxy server use-case.
I'd also like to point out that a more practical way to implement an HTTP proxy server would be to simply deploy an existing server like Squid.
精彩评论