Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have a site running on Umbraco 7.5.11. It has <500Mb of images in total in the '/Media' folder on disk.
However, the image cache (everything in App_Data/cache) exceeds 3Gb.
The site doesn't do much in terms of resizing. There are a couple of templates which use images with e.g. ?width=1200 appended to their URLs but other than that, not much going on.
The imageprocessor cache config is like this:
<cache name="DiskCache" type="ImageProcessor.Web.Caching.DiskCache, ImageProcessor.Web" maxDays="365" browserMaxDays="7" trimCache="false">
Would it help to set 'trimCache' to true?
Thanks for any advice. :)
Every time an image is requested with querystring parameters, then a cached version is created, and the cached version is used next time that image is requested, to prevent processing happening on every request.
The backoffice also uses this for thumbnails etc.
Overtime the cache can build up.
The way trimCache setting works, is every time an image is saved, the rest of the cache is purged of old images. this prevents the cache continually increasing in size, but depending on the size of your media, can cause load on the server at inconvenient times... a commit was made here to turn trimCache off by default to avoid high CPU usage...
So an alternative is to manually delete your cache files every few months, next time an image is requested, it will be processed again, and a new cached version saved to disk. The cache will begin to grow again...
... if the size grows rapidly (it will to begin with as the majority of images are requested again for the first time) and continues to rise far above the size of the images in the media section, and you don't have any responsive image strategies that might be requesting different sizes on the fly, then another consideration is anything 'trolling' your site with requests to images with different combinations of parameters...? have a look in your IIS logs, to see if any images are being requested at unusual dimensions... from unusual IP addresses - if server disk space is a consideration, consider configuration the cache to be stored in Azure Blob storage or similar cloud location.
Thanks Marc. It doesn't sound like turning on trimCache would be wise. As you say, it might be that some kind of external bot/whatever might be "assisting" here by requesting images with querystring params. I did see some docs somewhere about locking this stuff down so I'll have a more detailed look into that. Thanks for your help.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted