Skip to main content
Gotta Dance
Inspiring
March 23, 2023
Answered

Set After Effects To Clear Cache Upon Open/Close

  • March 23, 2023
  • 2 replies
  • 2451 views

Is there a feature, script, or plugin available that clears the cache upon opening/closing After Effects? I have to clear the cache lately at least once a day. Honestly, I'm clearning my cache more than I take out the trash. 

 

I'd really like to just have it clear without needing to tell it. Is there something available that can help?

Correct answer Dan Ebberts

I guess you could add a one-line script like this to AE's Scripts/Startup and/or Scripts/Shutdown folders (haven't tried it though):

app.purge(PurgeTarget.ALL_CACHES);

2 replies

Warren Heaton
Community Expert
Community Expert
March 23, 2023

Have you tried using ChatGPT?

 

Here's what came back when I tried:

To clear the cache automatically when After Effects shuts down, you can create a script that runs when the application is closed. Here's an example script that you can use:

 

This script creates a function called clearCacheOnExit that clears all caches using the app.purge(PurgeTarget.ALL_CACHES) command, and then adds an event listener that runs the function when the application is closed using the app.addEventListener("afterClose", clearCacheOnExit) command.

To use this script, save the script with a .jsx file extension. Then, move the script file to the "Scripts > ScriptUI Panels" folder in your After Effects installation directory.

When you launch After Effects, the script will automatically run when the application is closed, clearing the cache and helping to improve performance and prevent errors in your project.

Gotta Dance
Inspiring
March 23, 2023

Awesome, no I haven't tried using ChatGPT. Sounds like Mother from the movie, Alien. 

 

Very comprehensive. Thanks guys! I'll give it a shot!

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
March 23, 2023

I guess you could add a one-line script like this to AE's Scripts/Startup and/or Scripts/Shutdown folders (haven't tried it though):

app.purge(PurgeTarget.ALL_CACHES);