1. A method for optimizing an application served from a server to a client across a network, comprising: providing a first code segment to a client; determining a plurality of parameters for an execution environment of the application based on the first code segment; providing the plurality of parameters to the server; and determining a second code segment for configuring the application based on the plurality of parameters.