Hi!
Thanks for the reply! this actually helped but I still have some problem. Let me explain. I save all the targets in a different file so that when I rebuild the rig I can apply them. Indeed on some targets there were orig shapes. I removed them and now when I build the rig through my script it caches correctly on the gpu. However, as soon as I save the file and I reopen it then it won't cache it on the gpu anymore. I tried to turn it on/off, I tried to switch between smooth preview and not etc. The result doesn't change.
Then I had kind of an epiphany, and I saved the file as .mb rather than .ma and all the problems are gone. Everything works as expected. However the client will need the .ma as well so I still have to figure this out. Also I noticed that now when reopening the file, whether it is .ma or .mb after you open the file and the viewport is loaded (so the rig appears) maya stays frozen keep loading stuff for a couple of minutes (it is like is loading the outliner since that doesn't show anything during this freezing time), before it would only take few seconds. I feel like this is related to the gpu problem.
Thanks again!