Search…

X3 Photo Gallery Support Forums

Search…
 
florent
Experienced
Topic Author
Posts: 98
Joined: 02 Jan 2008, 17:53

a, lot off files

03 Jan 2016, 09:20

Good morning and happy new year for 2016.
Because I start preparing my server for the last version i decide to do some file cleanup inside different folder.
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 :cry:
I want to know if this situation is normal & if I have to do some regular cleanup inside the following folders ?
Thanks for your reply.*
Florent
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13999
Joined: 30 Sep 2006, 03:37

Re: a, lot off files

03 Jan 2016, 10:39

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 :cry:
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.
 
florent
Experienced
Topic Author
Posts: 98
Joined: 02 Jan 2008, 17:53

Re: a, lot off files

03 Jan 2016, 13:14

Hello Karl, thanks for your reply

"Nothing wrong with clearing the content of these folders once in a while, but nothing wrong in keeping it either"

For me it's important don't keep too many "working files" because, like many Internet Web Provider, I don't have unlimited storage size & unlimited files (i my case I got 2.5 Go and 250 000 max files :(
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13999
Joined: 30 Sep 2006, 03:37

Re: a, lot off files

03 Jan 2016, 23:20

florent wrote:"Nothing wrong with clearing the content of these folders once in a while, but nothing wrong in keeping it either"

For me it's important don't keep too many "working files" because, like many Internet Web Provider, I don't have unlimited storage size & unlimited files (i my case I got 2.5 Go and 250 000 max files :(
Ok, but I already explained why the image cache is intentionally built, and why deleting it will just cause it to rebuild itself. What is the question? There is no option "don't use cache", and if there was, it would make your website very very slow, because images would have to be created on-the-fly continuously. The image cache mechanism is a crucial part of any modern gallery application, even Wordpress does this.

Proportional to the amount of images in your gallery, you will need to reserve space for the cache also.
florent wrote:(i my case I got 2.5 Go and 250 000 max files :(
2.5GB? Not sure what hosting this is. I checked all the big hosting companies, and their $5 plans now all include minimum 20 GB storage, and many even offer unlimited storage. Storage space these days should not be an issue for anyone.

Check hostgator, godaddy, inmotionhosting, bluehost, arvixe, siteground, dreamhost, hostpapa ...
 
hr-foto
Posts: 6
Joined: 25 Dec 2015, 06:54

Re: a lot of files

07 Jan 2016, 11:46

Hi Karl,

when I backup the website from the server it would not be useful to backup the cache folder.

Which folder/ file has to be backuped, not to loose any setting, description eg..

Best regards
Herbert
 
User avatar
Martin
Experienced
Posts: 651
Joined: 30 Jan 2011, 23:24

Re: a lot of files

07 Jan 2016, 14:47

hr-foto wrote:Which folder/ file has to be backuped, not to loose any setting, description eg..
Only:

/config
/content
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13999
Joined: 30 Sep 2006, 03:37

Re: a lot of files

07 Jan 2016, 21:36

Martin wrote:/config
/content
correct