Stop Caching to user drives


Just a bit of background of our setup before I mention the issue

  • We are building the plugin via base configuration. Our configuration lives on a path
  • The latest core was used to build the plugin.
  • The SHOTGUN_ENTITY_ID and SHOTGUN_ENTITY_TYPE are populated in the environment.
  • We don’t use Shotgun Desktop, Shotgun Create, or the web UI to launch into the DCC as we have own DCC launcher
  • We have a common network location and our own system of caching repos.

I am trying to figure out a way to not cache config and the core, ie the config and install folder in the user directory.

I tried to set the following environment variables before starting

env.TK_BOOTSTRAP_CONFIG_OVERRIDE = '{this.root}/tk_config' env.SHOTGUN_BUNDLE_CACHE_PATH = '{this.root}/build_output/bundle_cache' env.SHOTGUN_BUNDLE_CACHE_FALLBACK_PATHS.append('{this.root}/build_output/bundle_cache')

The SHOTGUN_BUNDLE_CACHE has stopped the caching of the all the apps, which is great. However setting the other two variable does not disable the caching of the config and core.

Please let me know if you need more clarifications



1 Like

Hi Pritish

There isn’t a way to specifically move just those element. You can set the SHOTGUN_HOME environment variable, and that will move the whole user cache folder.

However I really advise against moving it to a server location, for the following reasons:

  1. This location needs to be unique to the user. However I suppose you could set the env var to point to a unique path on the server for each user.
  2. My biggest concern would be performance. I don’t know how performant your server is, but it’s unlikely to be as fast as the local drive on the machine. We use a SQLite db for storing a local path cache, and having this stored on a server location can very noticeably impact on performance. The path cache aspect could in theory be still kept local if you modified the core hook to do so. But there are other places we use SQLite dbs such as the browser action caches, and that can’t be individually controlled so that would go where ever you set the SHOTGUN_HOME env.