1. A code caching system comprising: one or more processors; and a machine-readable medium comprising instructions stored therein, which when executed by the one or more processors, cause the one or more processors to perform operations comprising: receiving a first indication of primary source code awaiting execution; checking a resource cache for cached data corresponding to the primary source code in response to receiving the first indication; and upon a cache miss in the resource cache: obtaining first executable code compiled from the primary source code; selecting secondary source code referenced in the primary source code to serialize and cache based on one or more of a size of the secondary source code or compile time of the secondary source code; obtaining second executable code compiled from the selected secondary source code; serializing the first executable code and the second executable code into serialized code that is configured to be reconstructed in multiple execution contexts; storing the serialized code as cached data in the resource cache; obtaining an execution history of the serialized code; and replacing the previously selected secondary source code with other secondary source code based on the execution history of the serialized code.