1. A method of cellular or WIFI traffic optimization, the method, comprising: detecting outgoing traffic from a mobile device connected to a server and subscribed to an operator of a public Internet Protocol (IP) network; performing, at the mobile device, one of (i) optimization of the outgoing traffic based on an optimization policy set of the operator and (ii) allowing optimization of the output traffic by a remote entity of the server and based on the optimization policy set, when the outgoing traffic is directed towards the private IP network and the private IP network is owned by the operator, the optimization policy set being same for the private IP network and the public IP network, allowing, by the mobile device, the outgoing traffic to reach the destination corresponding to the destination network address without optimization by the mobile device or the remote entity, when the outgoing traffic is directed towards the private IP network and the private IP network is not owned by the operator of the public IP network, and receiving a response from the remote entity when the outgoing traffic is directed to the public IP network, wherein the response to the outgoing traffic directed towards the public IP network is optimized by the remote entity based on the optimization policy set.