Don't put shader cache in user temp folder by default

1 month 1 week ago #1 by Nazo
By default ReShade puts the shader cache in the user's "temp" folder.  There are several problems with this, but the biggest one is the "temp" folder isn't really temporary, despite its name.  Tons of programs dump stuff in there and forget to (or intentionally choose not to) delete the stuff they have left behind.  This means it's a mess and if users try to keep it clean it can be almost impossible to navigate manually.  In fact, myself and many other people simply set the temp folder to be automatically erased from time to time (I have something that does it every startup which I think is probably the most common interval.)  Of course then that defeats the purpose of even using it as a cache folder in such cases anyway, even putting aside what an incredible mess it makes.  You may as well just cache only in RAM if the cache is only really expected to survive one use.  What I personally prefer is to put a "cache" folder under the reshade-shaders folder for each game so it has a dedicated cache for each game (it's really not that big anyway.)  I presume the idea is to work with the assumption that the user might not have write access to the game's folder, but of course if they had access to put ReShade in there they should have write access to its folder.  Though if you're really worried about permissions you could manually set permissions when creating the cache folder itself to be user group permissive.  This can also be useful on multi-drive or multi-partition systems (not uncommon with SSDs) where the temp folder may not necessarily reflect the location with the most free space to work with.  It's worth noting also that since it's a dumping grounds freely used and messed with by various things (especially installers) it's possible that some of them can interfere with ReShade's cache anyway.  Alternately, if there is absolutely no chance of clashing between different installs then it could at least be in a user folder (something under the user's %AppData% folder seems to be the most popular way to go there) which would be cleaner and make more sense than the temp folder anyway.

Honestly, I think all programs need to, as a policy, stop using the "temp" folder as a non-temporary storage or outright forgetting to remove their files when done using them (installers are particularly bad about this.)

Please Log in or Create an account to join the conversation.

1 month 1 week ago - 1 month 1 week ago #2 by crosire
It's intentionally in %temp%, exactly so that it is cleaned up by e.g. the built-in Windows disk cleanup tool, since it can become quite big (depending on how many effects are used and how many different resolutions and configs and games I have seen it grow beyond 1GB) and it's not a bad idea to clean it up every now and then to reduce the size to the actual working set again.

If you don't want it in %temp%, nothing stops you from changing the location. In ReShade.ini:

If you don't want to type that every time you install ReShade to a new game, put a ReShade.ini with that set next to the setup tool and the setup tool will apply that to every new game you install to.
Last edit: 1 month 1 week ago by crosire.

Please Log in or Create an account to join the conversation.