Hello Drupal developers. I have a question about the retention time of temporary files in Drupal's filesystem.
If you don't mind, could you please answer the following two questions?

1. Why is it set to take 6 hours to delete temporary files in the first place?
Why is the shortest time set for deleting temporary files in Drupal's file system to 6 hours? I doubted that a shorter time was not available.

2. Scope of influence when changing the setting of temporary_maximum_age
We changed the value of temporary_maximum_age in config/default/system.file.yml from 21600 to 10 in order to reduce the deletion time of temporary files.
As a result, temporary files can be deleted immediately by running the "Delete temporary file" cron after 10 seconds.
It is my understanding that the above setting change affects only the deletion time of temporary files, but is this correct?

These are my questions, I would be very happy if you could answer them.Thank you.

Comments

ressa’s picture

About the maximum age limit, perhaps 6 hours is viewed as a sane default?

10 seconds seems to short. If the files placed in the temp-folder are to be used for batch processing or a queued operation, where Drupal needs to place files temporarily in the temp folder, do some work, and then try to get the files, but they are gone, the process can fail ... If it needs to be shortened, I think 15 minutes would be a minimum.

Command to set temporary maximum age to 15 minutes.

$ drush config:set system.file temporary_maximum_age 900
$ drush config:get system.file temporary_maximum_age
'system.file:temporary_maximum_age': 900
yoshiaki.masai’s picture

Thank you for your reply. Sorry for the late confirmation. However, the content of your reply seems to be slightly different from what we want to confirm. By temporary files we mean files that are no longer used anywhere on Drupal. This is a case of changing the deletion time of files whose status is "temporary" by 10 seconds.

gisle’s picture

You're asking about the setting temporary_maximum_age, then you write:

By temporary files we mean files that are no longer used anywhere on Drupal.

However, the value of temporary_maximum_age controls the maximum age of all files that are placed in the temp folder by Drupal. This setting is oblivious to what you mean when you say "temporary files". If it is set too short, things will break for files you may be unaware of, but are processed by Drupal for internal purposes, without you having knowledge of their existence.

- gisle