This is a highly advanced problem. Basic code won't help you.
EDIT: and there is no general solution. To have it work on a usefull performance, it must be done very specific to the end usage and the projects structure.
EDIT: and there is no general solution. To have it work on a usefull performance, it must be done very specific to the end usage and the projects structure.