JustCarmen / webtrees-fancy-imagebar

Fancy Imagebar module for webtrees
http://justcarmen.nl
GNU General Public License v3.0
12 stars 6 forks source link

shorten logout time (afmelden) #104

Closed arbor95 closed 2 years ago

arbor95 commented 2 years ago

is it possible to shorten logout time (afmelden), (perhaps by showing the same images, caching last selection) or only to renew the image selection after a (short or long) period of time? Then I would activate that not only on the homepage.

JustCarmen commented 2 years ago

No, that is not possible. When you log out, it is important to recalculate privacy. Not all images can be shown to a non-logged-in visitor. But it doesn't take that long to log out, does it? In my case, it is only a second.

arbor95 commented 2 years ago

If it were only a second, I would not complain. In my case simply starting https://freris.de/tree/frese it is 10 seconds and the logout is 20 seconds.

without imagebar, the time start is less than 3 sec and the logout less than 5 seconds.

arbor95 commented 2 years ago

The problems seems to be the calculation of privacy. a refresh, if logged in, is quick. not logged in: slow.

JustCarmen commented 2 years ago

Performance problems are always difficult to solve. But it could indeed be a privacy problem. You can speed up privacy calculations by adding a death record to individuals whose death can be inferred from other data. You can use the datafix module to accomplish that. It might help speed things up.

arbor95 commented 2 years ago

I don't know your program, but you can remember privacy from checking the images. That always takes time. In case of creating the final random selection, these ones can be examined for privacy. So only some few tests must be done.

JustCarmen commented 2 years ago

You didn't say if you have added missing death records. I want to know if it makes any difference or not.

arbor95 commented 2 years ago

I did and there is no difference. If you want I can create an admin account at freris.de for you!

JustCarmen commented 2 years ago

Yes, that might be a good idea. But I'll be away without my laptop for a few days, so I won't be able to look at it until next week.

But you can email me the login details in advance.

JustCarmen commented 2 years ago

I went to your website to get an idea of the performance. The Fancy Imagebar is placed on the homepage only, so I expect only to have a problem when logging out from the homepage. But that is not true. I tried different other pages and logging out takes from every page I tried 10 seconds or more. When I disable the Fancy Imagebar the logout time decreases significantly on all pages.

But I can't tell you why this is happening. I don't have a similar experience on my own site. We have about the same amount of images so that's shouldn't be a problem. I don't see anything unusual in the privacy settings either.

The only thing I can think of right now is that there might be a conflict with another custom module. Maybe you should try to disable them all to see if it improves performance.

JustCarmen commented 2 years ago

Forget my previous message. I just realised that although we have approximately the same amount of images on our websites, I use only images of the type 'photo' in the Fancy Imagebar. In my case that's about 175 images. I can reproduce the issue when loading all images in the Fancy Imagebar (I have abt. 1200 images in total on my site). In that case, the logout time increases by several seconds.

I have no idea yet how to fix this. But I will see what I can do.

arbor95 commented 2 years ago

It on the homepage only cause of slow response time for a visitor. I will not select a subpart of the images, cause I have to do it on each import of gedcom again. For quick select I have to move the wanted images to a subdirectory, and remake the links (what is boring too). So reducing the time for privacy checking, by only checking the images finally seen on the website, seems to be a possible solution for me (and not difficult to implement, I think).

How can be done a selection "photo" ? My images do not get tagged with "photo".

JustCarmen commented 2 years ago

So reducing the time for privacy checking, by only checking the images finally seen on the website, seems to be a possible solution for me (and not difficult to implement, I think).

As far as I can tell now, this is not a simple change but requires a partial rewrite of the code. I will see what I can do.

How can be done a selection "photo" ? My images do not get tagged with "photo".

Then it is not possible I think. When uploading images you can set the type like photo, document, book etc. I don't see how you can set the type in a easy way for multiple images later.

JustCarmen commented 2 years ago

I've made some changes. Would you please test if this helps in your case?

Changes are made to one file only.

Please download this file: https://github.com/JustCarmen/webtrees-fancy-imagebar/raw/7303597eb68102854bdb8f9cf0f5efb0a39afb98/FancyImagebarModule.php and overwrite it with the one on your server.

Let me know your findings.

arbor95 commented 2 years ago

Works fine. I enabled again on all pages. Thx

JustCarmen commented 2 years ago

Glad it works. Thanks for testing.