Patent ID: 8819539

Claim:
A method for on-the-fly rewriting of a plurality of URLs in a webpage, the method comprising: receiving a request for a webpage from a client-side of a network; retrieving the webpage at a server-side of the network, the webpage comprising a plurality of hyperlinks, an original code that includes code that is tagged to be performed by the client-side, and one or more functions set to run at the server-side; analyzing the plurality of hyperlinks of the webpage at the server-side, wherein the analyzing comprises parsing the webpage at the server-side: optimizing the plurality of hyperlinks of the webpage without affecting the original code of the webpage to generate an optimized webpage at the server-side; identifying a first function of the one or more functions that is set to run at the server-side and also set to run at the client-side and not stripping the code of the first function; stripping code from at least one of the one or more functions set to run at the server-side and not also set to run at the client-side; transmitting the optimized webpage with the original code, and without the code that was stripped from the at least one function, from the server-side to the client-side over the network; and performing the code that is tagged to be performed by the client-side.