hey out there, we hit an interesting one today...
one of our deployments to a vps running windows and iis locked up for nearly half an hour. when we dug into the logs of the devops pipeline, we noticed hundreds of thousands of entries looking like this:
Deleting file (client-site\umbraco\Data\TEMP\MediaCache\0\0\0\2\d\4\3\c\2574.jpg).
Deleting file (client-site\umbraco\Data\TEMP\MediaCache\0\0\0\2\d\4\3\c\2574.meta).
Deleting directory (client-site\umbraco\Data\TEMP\MediaCache\0\0\0\2\d\4\3\c).
Deleting directory (client-site\umbraco\Data\TEMP\MediaCache\0\0\0\2\d\4\3).
Deleting directory (client-site\umbraco\Data\TEMP\MediaCache\0\0\0\2\d\4).
Deleting directory (client-site\umbraco\Data\TEMP\MediaCache\0\0\0\2\d).
Deleting directory (client-site\umbraco\Data\TEMP\MediaCache\0\0\0\2).
it turns out that at some point a hacking attempt had been run against the server and the
MediaCache
had grown to over 20gb of cache entries. the pipeline was recursively going into each folder and deleting them...
we've just taken a look at
https://docs.umbraco.com/umbraco-cms/v/13.latest-lts/reference/configuration/imagingsettings and we're going to use
CacheFolder
setting to move the folders/files to another location on disk so they don't get deleteded on a deployment.
however we wanted to know more about the
CacheMaxAge
setting:
Specifies how long a processed image may be used from the server cache before it needs to be re-processed again. The default is one year (365 days, formatted as a timespan).
does anyone know if this setting causes umbraco to clean up the files and folders? e.g. if a cache entry is found that's older than the specified timespan it physically removes the files/folders from disk?