Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: Large cache capacity

26 Jul 2024, 03:36

Dane wrote: But it seems i get now a new problem. I have just noticed that my menu is now much longer, as all hidden directories are listed there. Do you know how this happens?
I don't see how that's related to cache, as it has nothing to do with cache. Link?
 
User avatar
Dane
Experienced
Topic Author
Posts: 170
Joined: 04 Dec 2020, 15:05

Re: Large cache capacity

26 Jul 2024, 04:00

www.LinsenSchuss.de

There is also the example menu shown. I only do your modifications in this file.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: Large cache capacity

26 Jul 2024, 23:24

Dane wrote: www.LinsenSchuss.de

There is also the example menu shown. I only do your modifications in this file.
I don't see how that page is supposed to be hidden though, as there are not settings in that page that hides it. Normally, you would click on that folder in the panel, and click "hide". It seems the page got unhidden somehow, but this is unrelated to the cache.
 
User avatar
Dane
Experienced
Topic Author
Posts: 170
Joined: 04 Dec 2020, 15:05

Re: Large cache capacity

27 Jul 2024, 00:47

I have also just noticed that the order of the menu items has changed completely. I have now hidden all the corresponding folders again and reorganized the order. And not only that, a blog entry in my blog folder has been changed to a category. I only had the categories "Photography" and "Astrophotography". 
Screenshot 2024-07-27 064311.png
Screenshot 2024-07-27 064311.png (381.45 KiB) Viewed 3099 times
I am sure that I have neither changed the visibility of folders nor moved their order. Im also didnt move any filder like the example in my Blog folder.  I also think that something like this cannot happen by mistake. So far, I haven't uploaded or created anything for weeks. 

Something strange is going on here. I hope I don't find any more unwanted changes.
 
User avatar
Dane
Experienced
Topic Author
Posts: 170
Joined: 04 Dec 2020, 15:05

Re: Large cache capacity

27 Jul 2024, 02:12

Another problem. I have now uploaded another photo. When I try to open it on the page, the message "Page could not be found. This page returned a "404 Not Found" error." appears. However, I can see it in the panel and also open it enlarged. 

The first on in this gallery: https://www.linsenschuss.de/galerie/astrofotografie/
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: Large cache capacity

27 Jul 2024, 22:48

Let's look at one thing at a time here.
Dane wrote:a blog entry in my blog folder has been changed to a category.
This is very easy to diagnose, although now it seems you have fixed it already. The only reason there could have been a category "Der Comet ..." inside blog, was if that folder existed directly inside /blog/ ... There is no chance that disabling cache can do something like that, moving folders physically.
Dane wrote:Im also didnt move any filder like the example in my Blog folder.
May I ask, how did you fix this? Where did you locate the folder that wasn't supposed to show?

I'm not saying that you moved the folder there. But it can only show as category in the menu if it was a folder in that actual location. Commenting out a line in PHP won't move folders, and X3 can't move folders by itself anyway, it's just not possible.
Dane wrote: Another problem. I have now uploaded another photo. When I try to open it on the page, the message "Page could not be found. This page returned a "404 Not Found" error." appears. However, I can see it in the panel and also open it enlarged. 

The first on in this gallery: https://www.linsenschuss.de/galerie/astrofotografie/
I don't know if you checked, but almost all iamges on that page go to "page not found", and the explanation is easy: 1. You have disabled X3 popup for that page. Was that intentional? That leaves the pages to open as "image landing pages" (less useful) ... and with that, you have a problem because of all the url unfriendly characters you have in the file names _underscore, empty spaces etc ...

First of all, let's take a step back please. All these issues you have noted in this post have nothing to do with disabling cache. They are changes that you or someone else have done at some point or other. They need to get corrected.
 
User avatar
Dane
Experienced
Topic Author
Posts: 170
Joined: 04 Dec 2020, 15:05

Re: Large cache capacity

28 Jul 2024, 08:42

mjau-mjau:
May I ask, how did you fix this? Where did you locate the folder that wasn't supposed to show?
The folder was here: https://www.linsenschuss.de/blog/Astrofotografie/

This folder: https://www.linsenschuss.de/blog/Astrof ... t-Adapter/

it was hidden, but I'm sure that i didn't set this to hidden. It's an older folder an i didn't any changes here for a long time. 

Yesterday, while searching, I found a folder that was hidden, even though it shouldn't be. I don't want to claim that this is necessarily connected to the cache problem. But for me it is inexplicable that all menu folders were visible at the same time as the problem, although several are hidden. Also that a folder in my blog has moved and a folder was hidden, although it wasn't before. Something like that doesn't happen with a single accidental click. 

Nobody has access to my panel. And if someone should have gained access in a dubious way, I can hardly believe that someone would just arbitrarily change such settings as the visibility of the folders. 

It is also incomprehensible to me that after using the X3 Gallery for a long time, hundreds of gigabytes of cache are suddenly generated every two days, even though I have barely uploaded any photos. As far as I know, the last update was almost a year ago. I haven't made any changes myself, which is why it all seems quite strange to me. But maybe I'm looking at it the wrong way because I don't understand it. So please don't misunderstand. 
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: Large cache capacity

28 Jul 2024, 23:04

I don't know what the above means. I see two folders. If I am to diagnose this problem, I need to see the problem.
Dane wrote:Yesterday, while searching, I found a folder that was hidden, even though it shouldn't be.
And did you unhide it? If yes, then how can I diagnose. The simple explanation here is that if something is hidden, it's in the settings of that page. If you can show me something that is hidden while it's not supposed to be, I can prove it by showing you the setting in the folders page.json file.

Surely you understand this has nothing to do with disabling cache? And surely you understand these changes can't make themselves, unless someone else is accessing your data?

I'm a bit unsure what you want me to say. X3 does not change folders by itself. It's been out over 10 years and of course nobody else has reported anything like this. I am also the developer, and I have no interest in making things up. If you can show me a problem, I will show you why it's like that from the page's settings (nothing to do with cache or anything).
Dane wrote:Also that a folder in my blog has moved and a folder was hidden, although it wasn't before. Something like that doesn't happen with a single accidental click. 
It's literally 100% impossible for X3 to MOVE folders on your disk, unless you do it from the panel. You could hire an expert coder to see that. It certainly can't be related to commenting out one line of code that simply blocks caching files!
Dane wrote:It is also incomprehensible to me that after using the X3 Gallery for a long time, hundreds of gigabytes of cache are suddenly generated every two days, even though I have barely uploaded any photos.
I thought this was temporarily resolved by disabling the cache in the code?

If there is another NEW cache problem, which I doubt, then you better post about that instead.
Dane wrote: As far as I know, the last update was almost a year ago. I haven't made any changes myself, which is why it all seems quite strange to me. But maybe I'm looking at it the wrong way because I don't understand it. So please don't misunderstand. 
I am not misunderstanding. I'm just saying, X3 does not make changes by itself, certainly can't move entire dirs. I don't how else to say it. I have no reason to claim this if it was not the truth.

If you see another problem, then please post it here, and let me diagnose it BEFORE you try to fix it.
 
User avatar
Dane
Experienced
Topic Author
Posts: 170
Joined: 04 Dec 2020, 15:05

Re: Large cache capacity

29 Jul 2024, 02:06

Perhaps my misunderstanding comes from the fact that the Chache problem suddenly appeared without any action on my part, just like all these changes. I didn't do anything except delete the Pages directory in the cache folder several times. I think we won't go any further here, as the situation is unclear. In my case, several changes were made in the panel which are not comprehensible. 

If such an incident occurs again, I will not change anything and will report it here. 

Thanks for all the information.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: Large cache capacity

29 Jul 2024, 05:25

I understand that this is confusing, and I don't know what's happening (unless I can get a specific issue to diagnose), but this is the lifespan of what we have been through in this topic:

1. There is a problem where cache is building up, and I am aware of this issue, and I will be looking into a solution soon. Except for the massive folder of course, this did not cause any other problems.

2. Following my advice in this post 3 weeks ago, you disabled cache by commenting out the line "file_put_contents($this->cachefile, $data);". This solved the CACHE issue for you (although it's not optimal to disable cache, so this will be resolved soon). As you can imagine from that line of code, commenting it out does ONE thing and one thing only: STOPS saving php cache file on the disk. It can't do anything else, certainly not move things around or change your settings.

3. You are reporting some issues with hidden pages appearing and folders being moved. I can't say much about this, but there is no way commenting out the line of code that saves cache to disk can do this. No "code" could really do something like this. Even if it could, why would it be random moving folders around and applying changes? If this is an issue for you, it's caused by something entirely separate, which I could explain if I can diagnose one issue directly. Maybe it's even something in your browser, some cache vs menu setting, which I can't even see or know, because I haven't been allowed to diagnose.
Dane wrote: Perhaps my misunderstanding comes from the fact that the Chache problem suddenly appeared without any action on my part,
Not exactly, because the cache issue is certainly appearing after one of the following events:

1. Your server got updated.
2. Your X3 got last updated.

Your cache issue has been ongoing since the above event started. It didn't just magically start from nothing. This is what I need to find out when I work towards next release.
Dane wrote:I didn't do anything except delete the Pages directory in the cache folder several times.
This is different. The cache issue started because of a change on server or in code. Changes stored inside your page.json files or folders moved around, this can't be achieved by updating X3 or changes on server or commenting out a single line of code that just saves cache files.

For what I know, it could have been the host doing maintenance and some things ended up wrong? I really don't know. I can only diagnose next issue if you report it here and DON'T fix it.

Anyway, I will be looking into a fix for the cache issue shortly. That is the priority. I don't know what happened to your settings and folders, as this is a separate issue from cache.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: Large cache capacity

20 Aug 2024, 06:02

Hi Dane,

I have now researched and solved this issue in preparation for next X3 release.

It might be a couple of weeks until this is available in next X3 release. In the meantime, you can download the file below and try it out yourself if you like:
https://www.photo.gallery/download/?cache.inc
  1. You should first delete all files in /_cache/pages/* so that you can easily check results.
  2. Rename /app/cache.inc.php to /app/cache.inc.php.bac, just so you have a backup of the existing file.
  3. Replace /app/cache.inc.php with the updated file you downloaded above.
What was the cause?
There were a combination of issues causing the cache folder to expand continuously.
  1. With the images sitemap creator launched in X3.32.0, Google (and other search engines) are now visiting your image landing pages, which in turn creates one cache file for each image on your website. If you have 2000 images on your website, it would eventually create 2000 cache files for each of your images. This isn't really a problem in itself, although it would increase the volume of files exponentially.
  2. My research detected that cache files are getting created for strange requests that start with /index.php/ like /index.php/some/path/. These requests would always point to the home page, because it's not a valid request, but each request caused a cache file to get created. These requests are made by BOTS that may have picked up on /index.php and are trying to load relative or random urls starting with index.php.
  3. The X3 cache auto-removal tool was never very effective. For example, if you renamed a path /path1/galleries/.. to /path2/galleries/.., cache files for old paths would never get removed. The auto-removal tool would only delete expired cache for paths that still exist (for example after modifying a page's settings). When you make a change on one page, ALL existing page cache becomes invalid, because that single page may affect all other pages (menu, folders, galleries, settings etc). Therefore, after a single change, you could end up with a large amount of expired cache files, which only got removed slowly or almost never.
Ultimately, any combination of the above in could lead to a massive build-up of files in the _cache/pages dir.

What has been fixed?
  1. After any change in panel, ALL expired cache files will now automatically get deleted on first page load in browser. This itself will basically maintain the cache effectively.
  2. Bot requests to /index.php/path/here/ no longer creates cache files, as it's basically just a request to the home page anyway.
  3. Although not strictly necessary with the two fixes above in place, I have now disabled caching of image landing pages. Image landing pages are meant for bots (Google bot), and aren't normally visited by humans. Besides, image landing pages only contain a single image, and will already process and load fast without caching. Caching is more important for menu, galleries and folders.
 
User avatar
Dane
Experienced
Topic Author
Posts: 170
Joined: 04 Dec 2020, 15:05

Re: Large cache capacity

20 Aug 2024, 12:05

Hi Karl,

thank you for your investigations and explanations.

For me, after your first fix, it's fine so far. I wouldn't change anything else until the official update comes out. 

Can there be a problem with the official update due to your first fix? Or do I have to undo this? or will the modified file simply be updated with the update?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: Large cache capacity

20 Aug 2024, 22:02

Dane wrote:For me, after your first fix, it's fine so far. I wouldn't change anything else until the official update comes out.
Keep in mind, the first fix involved entirely disabling page cache. If your server is sufficiently fast, you might not notice any difference, but generally speaking, cache should be enabled to maximize page load speed.

If you want to wait, that's fine.
Dane wrote:Can there be a problem with the official update due to your first fix? Or do I have to undo this? or will the modified file simply be updated with the update?
This won't be a problem. All files will get overwritten with new ones.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: Large cache capacity

26 Aug 2024, 02:05

X3.33.0 was released, with a fix for the issue in this topic:
https://www.photo.gallery/blog/photo-gallery-x3-33/
 
User avatar
Dane
Experienced
Topic Author
Posts: 170
Joined: 04 Dec 2020, 15:05

Re: Large cache capacity

26 Aug 2024, 03:12

Hi Karl,

Thank you, the updatehas been successfully complete.