Score:0

Ckeditor inline images path

fr flag

I am running a Drupal 9 site and I expect my users to upload a lot of files with the ckeditor functionality. All of those files will be stored in a single folder.

I heard that this will cause performance issue once there are a lot of files. To avoid this, I would like to include a timestamp in to the path where to file will be stored, similar to what Drupal does to regular file uploads.

Is there a way to achieve this?

I found this question but it's 5 years old and there is no real answer.

ru flag
*All of those files will be stored in a single folder. I heard that this will cause performance issue once there are a lot of files.* No, not really. Whatever you heard, it is totally outdated or doesn't apply to default Drupal.
leymannx avatar
ne flag
Premature optimization is the root of all evil
Score:0
cn flag

Although stock Drupal may be OK with tons of files in a single directory, some Drupal hosts (e.g., Pantheon) have limits:

From their docs:

Highly Populated Directories

If you have individual directories with tens of thousands of files (e.g. an image repository) it may be necessary to refactor this file structure to see good performance on Pantheon. The danger zone begins at around 50,000 files in a single directory, and performance drops off suddenly at over 100,000 files.

Drupal itself is capable of managing uploaded content into different directories based on the date or user, which is preferable to dumping all uploads into a single place. Refactoring an existing large-scale site with this issue is usually simply a matter of re-arranging the files and then updating the files table in Drupal.

If you did need to implement this, you might look at what the Filefield Paths module does.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.