Publish/subscribe paradigm provides a very effective and reliable scheme to implement P2P networks. In these systems, a crucial issue is to reduce the number of messages associated to the searching procedure, due to the delay that implies the delivery of contents. In this paper, we study the current publish/subscribe systems and propose an optimized middleware (OMCPS), suitable for the implementation of large-scale content delivery systems. The main idea behind our proposal is to reduce the conventional message distribution and searching by using a decentralized algorithm (the Chord). In addition, the internal OMCPS organization among the servers that conform the P2P system is transparent to the consumer and supplier applications.