Peer-to-Peer (P2P) architectures are very prevalent in today’s Internet. Lots of P2P file sharing systems using Gnutella protocol emerge out and draw attractions of millions of people. The “flooding” search mechanism of Gnutella makes it easy to be deployed, but also spawns numerous messages which leads to serious scalability problems. However, the locality discovered in both user’s share files and queries, enables us to use query-caching to shorten the search length and reduce the messages traffic. This paper makes an extensive study of query-caching in P2P systems and proposes an adaptive query-caching mechanism to manage the cached query reply messages according to the heterogeneity of the uptime of different peers. Along with several other techniques we proposed, our approach achieves a 30% reduction of average search length and a 61% reduction of query message traffic comparing with the previous query-caching mechanisms in the simulation, which indicates that our approach ...