Minor feedback: Cache should be in Local AppData, not Roaming

This is a very minor piece of feedback. On Windows, there are two AppData directories:

  • Roaming AppData (%APPDATA%): Files that are part of the user profile and should be synchronised to a domain controller on log out, for PCs that are on an Active Directory domain
  • Local AppData (%LOCALAPPDATA%): Files that are specific to this individual PC and should not be synced

This means that things like app preferences should go in the roaming directory, whereas things like temporary and cache files should go in the local directory.

However, PhotoStructure is currently storing its cache in the roaming AppData directory (%APPDATA%\photostructure\Cache). Could you please store this in the local directory instead?

It only really makes a difference for PCs that are part of a domain (eg. workplace and school PCs). It doesn’t make a difference for standalone PCs that are not part of a domain. It’s still good to follow the best practices though :slight_smile:

Edit: it looks like there’s two cache directories? I see one at AppData\Roaming\photostructure\Cache, but then there’s also one at AppData\Local\Temp\PhotoStructure?

Thanks for reporting this!

Absolutely, that’s totally reasonable.

I just checked though, and it seems like the code should be doing the right thing already:

export function defaultCacheDir() {
  if (isWin) {
    for (const ea of compactBlanks([getEnv("TEMP"), getEnv("LOCALAPPDATA")])) {
      if (isDirectorySync(ea)) return resolve(ea, AppName())

I’ll poke at it on my windows box and figure out what’s going on there.

AppData\Roaming\photostructure is burped out by Electron. I need to figure out how to disable that.

Got it.

So it looks like PhotoStructure is doing the right thing (storing the cache in Local AppData), it’s just Electron being weird and storing stuff in AppData\Roaming\photostructure\Cache. My mistake, I thought PhotoStructure controlled that one too :slight_smile: