1. A computer-implemented method for optimizing traffic over a wide area network (WAN) between two nodes, the method comprising: caching, in a local stream store of a local proxy, one or more streams of data transmitted over the WAN to a remote proxy; in response to a flow of data received from one of the clients of the local LAN, chunking using a predetermined chunk algorithm the flow into a plurality of chunks in sequence; and selectively indexing the plurality of chunks in a chunk index maintained by the local proxy based on locations of the chunks in the flow, wherein a number of chunks in a first region of the flow indexed is different than a number of chunks in a second region of the flow indexed, and wherein the chunk index includes a plurality of chunk index entries referenced to the steams stored in the stream store.