Patent ID: 8914542

Claim:
A method performed by data processing apparatus, the method comprising: routing, from a gateway within a network, a request by a first client within the network for a first webpage; routing, from the gateway to the first client, a first document associated with the first webpage that identifies first content to be embedded in the first webpage; receiving, at the gateway within the network, a message containing the first content to be embedded in the first webpage, the message conforming to a protocol that specifies a format of the first content, the message having been sent from a first server outside the network to the first client within the network; routing the message from the gateway to the first client; analyzing the message to determine whether the first content is static by determining whether the first content has at least a threshold similarity to stored content previously returned from an address outside the network, wherein the first content and the stored content both originate from the address outside the network; depending on a result of the analyzing, selectively causing the first content to be stored in the format specified by the protocol in a cache within the network; routing, from the gateway within the network, a request by a second client within the network for a second webpage; routing, from the gateway to the second client, a second document associated with the second webpage that identifies second content to be embedded in the second webpage; intercepting, at the gateway within the network, a request by the second client for the second content to be embedded in the second webpage, the requested second content associated with a second server outside the network, the second client having a direct connection with the second server outside the network; determining whether a copy of the requested second content is available in the cache within the network; if the copy of the requested second content is determined to be available in the cache within the network, transmitting a redirect response to the second client to cause the second client to retrieve the copy of the requested second content from the cache within the network; and if the copy of the requested second content is determined not to be available in the cache within the network, permitting the intercepted content request by the second client to be transmitted to the second server outside the network to cause the requested second content to be retrieved via the direct connection between the second server outside the network and the second client within the network.