"It [the framework] can't be installed pemanently cause each connection (SSH) can use different version of framework."
How many different versions are there? Can't you just store them permanently in a version-specific directory? (Copy over if needed, otherwise reuse the existing one.) Copying nothing is a lot faster than copying something.
If the number of different ones is going to grow without bound, then use 'find -ctime +3' or something to prune out the old ones. Then you'll have a time-bounded LRU cache. Whee!