Skip to main content
Known Participant
June 25, 2014
Answered

How to "empty the cache" by a script?

  • June 25, 2014
  • 3 replies
  • 11348 views

Hallo

I´ve set up a SSD for my After Effects Cache Drive and love the speed.

BUT:

Most times I open After Effects, a massage came up that says, that my cache drive is full.

So, is there a way to delete the cache folder or call the "empty cache" option in the pref menu by a startup or shutdown script?

Yes, I can try not to forget to do this by hand every time. ---> No chance!

A script is the better choice for me because it DO IT´S JOB EVERYTIME.




THX for your Help,

Andreas

This topic has been closed for replies.
Correct answer Alex White

OK. That are the hard facts.

- Maximum Disk Cache Setting is at 90 GB,

- Dialog Box is at ignore status.

Hopefully that are the best settings I can make.

If I clear the Disk Cache by the "clear disk cache" button in the AE Prefs, it first informs me, to be sure to delete all the (90GB) files on that cache and after doing so, the available size of that SSD is back at 127 GB. So I can say YES, the space on the drive is greater than the max disk cache size after the clearing.

The app.purge script works not in the way, that the files, saved on the cache drive, gets deleted. I´ve tried all of them, the ALL_CACHES, UNDO_CACHES, SNAPSHOT_CACHES and IMAGE_CACHES, found on page 27 in the CS6 scripting guide.

The UNDO and SNAPSHOT options in the After Effects >> Edit >> Purge section get not available anymore, after running this script….

app.purge(PurgeTarget.ALL_CACHES);

app.purge(PurgeTarget.UNDO_CACHES);

app.purge(PurgeTarget.SNAPSHOT_CACHES);

app.purge(PurgeTarget.IMAGE_CACHES);

alert("ALL DONE");

…., So something happened on the RAM files or so. But not to the saved files on my SSD. But, thank you for the idea. It´s always good to give it a try.

Now, just to know if we can do it, trying to delete the saved files by a script.

Yes you are right, if I load an old project, the files were gone and it takes a little time to re-render them, but that is a problem of having only a 127GB SSD drive.

THX so far ...


A little bit late, bit here is the thing.

Create a script with this content:

    app.executeCommand(10200);

    alert("Cache cleared!");

and put it into: Adobe\Adobe After Effects CC\Support Files\Scripts\Startup

It will clear All memory & Disk Cache.

3 replies

Participant
April 7, 2016

I'm trying to clear the cache at shutdown.

I've tried both app.executeCommand and app.purge but it doesn't seem to be working.
One thing to note is that there isn't a command for "All memory & Disk Cache" via app.executeCommand.

Anybody knows why?

vidjuheffex
Participating Frequently
October 27, 2015

How did you find this one!?

Todd_Kopriva
Inspiring
June 25, 2014

> Most times I open After Effects, a massage came up that says, that my cache drive is full.

What is the exact text of the message that you're referring to? I think that you are misunderstanding what the message is telling you. There should be no need to manually empty the cache.

ab_VFXAuthor
Known Participant
June 30, 2014

The message says::::

Your disk cache folder is on a drive that does not have enough available space to safely store the full amount specifies in your preferences. Please make more space available or go to Media & Disk Cache preferences to change the folder or maximum disk cache size.

The used Cache drive is my SSD with total 127GB storage, free 82GB, used 45GB.

Settings in the After Effects Preferences: Maximum Disk Cache Size 100GB

What does this message mean?

- In my eyes it only gives the information that there is not enough space to store the 100GB.

- Does it work anyway?

- What happened if the cache drive is full? Does the app opens a new folder on another drive?

Thanks, Andreas

Todd_Kopriva
Inspiring
June 30, 2014

The message means exactly what it says: There's not enough free space on your disk to safely store the full amount that you have allocated to the disk cache.

One thing to note: You should never fill a disk to maximum capacity. Doing so can lead to significant performance degradation.

After Effects checks to see if there is enough room on the disk to store the maximum amount that you have allocated to it, plus a safe margin. If that safe margin is not present, then you'll get this message. You're free to carry on anyway and ignore this friendly warning.

After Effects manages the cache itself; when it gets full, it starts dumping things from the cache that it thinks are least likely to be used soon.