Clear temp folder / composer cache

Hi,

What is the preferred way to clear the temp folder?
I’ve seen that in my application, this folder sometimes becomes huge, especially the composer folder inside the temp folder.

Here you can see that the temp folder is the largest folder inside the storage folder:
image

Going further you can see that the composer folder is the largest inside the temp folder:
image

It contains all kinds of caches from a while ago:
image

Can we safely just delete them? I understand that the contents of the temp folder should be cleared by the scripts that populate them in the first place, but in reality we see that this doesn’t always happen.

Can we safely delete everything in the temp folder or should we be mindful of keeping the folder structure inside?

Can we run a command to clear this maybe?
Please note that the following commands leave these folders untouched:

  • composer clear-cache
  • php artisan cache:clear
  • php artisan view:clear
  • php artisan config:cache

Thanks.

Hi,

From a new installation of OctoberCMS (v3.5.15), you will find this configuration :

├── ....
├── plugins
├── storage
│   ├── app
│   ├── cms
│   ├── framework
│   ├── logs
│   ├── temp
│   │   ├── public
│   │   ├── resize
├── tests

What version do you have?

php artisan october:about

If you are also on 3, I feel like these folders were created by something specific by your installation and of course, won’t be covered by any artisan default command.

Hi, thank you for your answer.
These are the values:

I notice that composer folder in most of my October CMS instances.
Most projects have a history though, and have previously been migrated from October CMS v2.

Weird is that some of the folders and files have a recent modified_date. This is what’s inside the temp > composer > cache > files folder:

Can you make any sense of that?