Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 23. Sep 2018, 21:53

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: cache folder issues.
PostPosted: 1. Jul 2017, 03:17 
Offline

Joined: 1. Jul 2017, 03:07
Posts: 5
Greetings.

Recently my working 2.3.4 started responding slowly to gallery loads, and I noticed the caching folder is doing something strange.
Tt used to create a directory structure that mirrored the images (ex: ./cache/mygallery/subfolder/image1.jpg.thumb.jpg), but now it is dumping all the files into the ./cache folder (ex: ./cache/mygallery_subfolder_image1.jpg.thumb.jpg). When I attempted to regenerate the cache, it only creates the first 1800 or so thumb/small files, then stops. Subsequent attempts to generate more fail to do so.
Is there some setting I might have accidentally touched that changes the way cache works? I need to get it back to creating the cache tree, as I frequently use the 'small' files to hotlink into forums I'm a part of.

A couple months back I tried to upgrade to 2.4.2, but noticed it immediate starting doing this as well, and that won't work for my needs, hence my continued use of 2.3.4.

Thanks for your time!

-- John


Top
 Profile  
 
 Post subject: Re: cache folder issues.
PostPosted: 2. Jul 2017, 14:14 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10895
Check
$use_cache_with_dir

by default this is
$use_cache_with_dir = false;

change it to
$use_cache_with_dir = true;
if you like a directory structure...

Best, Michael


Top
 Profile  
 
 Post subject: Re: cache folder issues.
PostPosted: 2. Jul 2017, 20:54 
Offline

Joined: 1. Jul 2017, 03:07
Posts: 5
excellent! thank you!

I guess I must have turned it on a long time ago and somehow it got dropped from my_config.php. (A User Error is not to be discounted, to be fair. :lol: )


Top
 Profile  
 
 Post subject: Re: cache folder issues.
PostPosted: 3. Jul 2017, 04:25 
Offline

Joined: 1. Jul 2017, 03:07
Posts: 5
another question related (at least to my difficulties here) to the cache... is it possible to disable the 0.5s delay during cache creation? I have need for quicker cache folder (re)generation for some testing i'm doing here, and I don't mind if I "crush" the VM I have TWG installed on.

Thanks!


Top
 Profile  
 
 Post subject: Re: cache folder issues.
PostPosted: 3. Jul 2017, 23:40 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10895
in the config_internal.php you can set:

$cache_gen_wait_time=0.5; // new 1.6 - time in s. This is the time the generator of the cache waits until it processes the next image - don't kill your server ;). should not be below 0.1
$max_gen_num=10000; // new 1.6 - Number of cache images that are generated by the admin. If the number is too big the scripts runs too long and the max_execution_time is not enough. I set this time internally to 10 min but this does sometimes not work. Then you have to change max_execution_time in the php.ini or decreate this value to a number your server can handle.


Top
 Profile  
 
 Post subject: Re: cache folder issues.
PostPosted: 4. Jul 2017, 04:58 
Offline

Joined: 1. Jul 2017, 03:07
Posts: 5
have there been any other reports of people having cache generation problems when image/file count exceeds a certain number? I haven't done more extensive and explicit tests, but it seems like, if I have enough images where the number of cached files will exceed 10,000 or so, there seems to be problems with creating all the cache files; it usually stops processing correctly around the 1,200 mark. (ETA: subsequent re-launches of the cache generator wouldn't create anything new, despite counting down through the full 10,001 it would report needing to be made.) I can do some more explicit testing if needed, but as it stands right now I had to, at a minimum I believe, raise the $max_gen_num value to over 10,000 (I used 1,000,000) and was finally able to successfully generate the full cache with my pictures folder having 15,864 images currently (with 30,388 cached images created.) I also changed $cache_gen_wait_time=0, and $max_execution_time=300, but I don't think they're the direct cause of my cache generation issues. I'm using v2.4.2 to generate the cache right now, and now that I know about the $use_cache_with_dir flag i'll probably stick with it.


Top
 Profile  
 
 Post subject: Re: cache folder issues.
PostPosted: 4. Jul 2017, 12:43 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10895
How have you changed max_execution_time? because setting is and that is is really used is a different thing.

And if you have 30000 images and setting the value to a higher number then that and it still works fine it is o.k. I think nowadays 10000 should be handled by every normal server. But this is an old setting where this was a problem...
$max_gen_num is really only the number of files the server can check. runinng this again does not help as this numer does generate the script that does generate the files.

And actually you don't need to generate the cache. Cache images are generated when needed. This is only an option to improve the display for the first user.


Top
 Profile  
 
 Post subject: Re: cache folder issues.
PostPosted: 7. Jul 2017, 01:42 
Offline

Joined: 1. Jul 2017, 03:07
Posts: 5
in response:
$max_execution_time = 300; (was 30)
$cache_gen_wait_time = 0; (was 0.5)
$max_gen_num = 10000000; (was 10000)

I suspect I'm not using TWG the way some people are; I'm using as an easy interface for all of my various pictures I've taken over the years. I like, and chose, TWG because it lets me leave my preferred underlying folder structures intact, let me keep my images at full resolution, and its ability to create smaller versions of my full resolution images for me, for presentation on the web.
I prefer to update the cache manually any time I update pictures, as I don't use the web interface upload method, and prefer to just dump them into the file system directly. I also like to eliminate the lag encountered when viewing new images for the first time. It's especially frustrating when on a mobile device for some reason.
I can tell you I didn't start to encounter "problems" until I dumped a bunch of images into the system that literally doubled the image count. Making the changes listed above appears to have solved my problems.


Top
 Profile  
 
 Post subject: Re: cache folder issues.
PostPosted: 7. Jul 2017, 01:57 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10895
Thats fine.

I will increase $max_gen_num in the next version as servers simply are much faster now ;).

Best. Michael


Top
 Profile  
 
 Post subject: Re: cache folder issues.
PostPosted: 9. Aug 2017, 07:52 
Offline

Joined: 26. Dec 2016, 16:58
Posts: 8
Is it possible to make the cache generation a background process?
Right now it requires an online session to be open during the entire process. If the PC hibernates the process stops.
And please reduce the cache_gen_wait_time as well. 0 is a bit drastic, but modern servers can handle it.

_________________
{รถ} Erik -- https://gallery.e-bachmann.dk


Top
 Profile  
 
 Post subject: Re: cache folder issues.
PostPosted: 9. Aug 2017, 11:01 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10895
No. Because I actually render only the urls and then execute it by Javascript.
But the cache is generated anyway at the first access. So generating it in advance is not really needed.
It only speeds up access for the first person who accesses the gallery.

Best, Michael


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
powered by phpbb | Datenschutz/ Privacy policy