• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to "empty the cache" by a script?

Community Beginner ,
Jun 25, 2014 Jun 25, 2014

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

10.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Jul 17, 2014 Jul 17, 2014

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.

Votes

Translate

Translate
Jun 25, 2014 Jun 25, 2014

Copy link to clipboard

Copied

> 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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 30, 2014 Jun 30, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Jun 30, 2014 Jun 30, 2014

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 01, 2014 Jul 01, 2014

Copy link to clipboard

Copied

OK. …. That means, if I do not want to lead to significant performance degradation, I have to clear the cache.


This brings me back to my question:

... 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?

By this way, the cache gets cleared before or after the work and give me more time to fill up the drive with cache files while working, so the significant performance degradation comes later.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 01, 2014 Jul 01, 2014

Copy link to clipboard

Copied

No, it means you should go into the Media & Disk Cache preferences and reduce the maximum disk cache size to an amount you can safely store on that disk without running out of space. AE will manage the cache when it fills up, but you need to make sure it doesn't use all available disk space. If it's your boot drive this is especially important as you always need some extra free space so the OS can work properly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 01, 2014 Jul 01, 2014

Copy link to clipboard

Copied

What does it mean for me?

I am running a 127 GB SSD as the Cache Drive for After Effects, nothing else. So "all" the storage can be used for the cache. In the moment the setting in the prefs is 100 GB for maximum cache size. I know that a FULL drive is slower than a drive where some GB´s are "reserved".

What do you think for that drive: a value of 2/3 of available space to set as the max?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 01, 2014 Jul 01, 2014

Copy link to clipboard

Copied

If the drive is only being used for After Effects I'm not sure why you're getting that warning. I thought it only appeared if there wasn't enough space to store the full amount without running out of space. If you clear the disk cache, is the space on the drive greater than the max disk cache size? It may be that it warns if a full disk cache leaves less the 10% space remaining or something like that. You could experiment, but Todd will be able to answer that better.

If you've run earlier versions of AE then I think they have a separate disk cache allocation, and may still be using up disk space you're not aware of. You would need to launch the earlier version and use the Empty Disk Cache button in the prefs to free up that space.

The CS6 scripting guide has an app.purge(PurgeTarget.IMAGE_CACHES) method which could theoretically be run as a startup script. I don't know if this purges the disk cache or just the RAM cache though.

The latest versions of AE use a persistant disk cache that holds cache frames/states from previous sessions, so if you're going back to the same project there's a good chance it will be less efficient if you purge the disk cache each time you launch.

Hopefully Todd will correct me on any of this if I'm wrong.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Jul 01, 2014 Jul 01, 2014

Copy link to clipboard

Copied

Paul is correct.

Try setting the preference for the maximum disk cache size to 90GB.

Also, you can ignore the warning message and choose the Never Again option in the warning dialog box to never see it again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 03, 2014 Jul 03, 2014

Copy link to clipboard

Copied

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 ...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 17, 2014 Jul 17, 2014

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Thank You Alex for your answer.

This works fine in AFX CC, but not in AFX CC14.

Do they have changed something in the scripting?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Sorry, I didn`t upgraded to AFX CC14, so I can`t tell you exact code,

but you can find out new ID using  Francois Leroy plugin:

Re: List of reference names for executeCommand();

Cheers

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Damn, this plugin is for PC only. I´am a Macoide.

Please, can someone take a look for the right ID.

BIG THANKS!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 09, 2017 May 09, 2017

Copy link to clipboard

Copied

LATEST

Thanks for posting.  Is there an equivalent command for "Clean Database & Cache"?

     (AE > Preferences > Media & Disk Cache > Clean Database & Cache)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 27, 2015 Oct 27, 2015

Copy link to clipboard

Copied

How did you find this one!?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 07, 2016 Apr 07, 2016

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines