florent wrote:I was surprised to find thousand files inside the "/app/_cache/images/rendered" & "/app/_cache/images/request" ?
I think the number of files are increasing very fast
I want to know if this situation is normal & if I have to do some regular cleanup inside the following folders ?
Why surprised? First of all, this situation is entirely
normal. The amount of items in
/request/ should be approximately the same as the amount of items in
/rendered/. This is where X3 stores your resized images, and depending on the layouts you use, X3 may create up to 7 different sizes from all your images. This means, if your gallery has 500 images, you could find 3500 files in both the /request/ and /rendered/ folder. If you don't make any changes to your website for a while (adding new images, renaming folders), the cache will eventually become complete (saturated).
Technically speaking, there is absolutely nothing wrong with this. Cached images are stored like this so that your server does not need to resize images on-the-fly as they are requested by a visitors browser. Unless you are struggling with server-space, which would be strange in these days when space is cheap, then you should just accept that this is how a modern app works.
Progressive Caching
These folders will build up progressively over time, but fastest in the beginning.
Why? Because you have many pages, in different layouts, visited by different devices (mobile/desktop), screen-resolutions (retina etc). If a request comes in for an image size that does not exist in cache yet, it will be created by X3, and stored in cache. As your pages are visited over time, by different devices, your image cache will build up also.
However ...
There are several cases where old/stale images are stored in the cache. For example, if you delete a file, the cached file does not get deleted. If you rename a folder, a NEW cache request will be made (because X3 can't know it's the same file). Therefore, depending on how frequently you are renaming files/folders, the cache could easily contain many unused old/stale requests/renders. This itself is not a problem, and will not slow anything down, although it will take some server space.
Can I delete content of these image caches?
Yes, but keep in mind your server will have much more work to do for a period of time after this. All images will need to get resized again from scratch, as the cache starts re-building. The only reason you would want to do something like this, is if you have been renaming folders a lot, or deleting many files, in which case you may have a substantial amount of "orphan" (unused) images in the cache.
Nothing wrong with clearing the content of these folders once in a while, but nothing wrong in keeping it either.