Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.2] Allow to disable session metadata tracking for guest users #37459

Merged
merged 7 commits into from
May 4, 2022

Conversation

Fedik
Copy link
Member

@Fedik Fedik commented Apr 2, 2022

Summary of Changes

This should improve performance for sites that does not use User registration/login feature.

We already have an option to disable "Track Session Metadata",
However it more usefull to be able to disable it only for non registered users, while keep track of metadata for loged in users.
That what I made here.

Testing Instructions

Enable debug with DB queries enabled.
Visit the site frontend (do not login) and check how much DB queries.

Apply patch.
Go to global configuration and set "Track Session Metadata for non registered Users" to "No".
Visit the site frontend again (do not login) and check how much DB queries.

Expected result AFTER applying this Pull Request

All should continue work as before, without any errors.

And it should reduce 2db query.

Documentation Changes Required

Yes, I guess, need a description for this feature.

@dgrammatiko
Copy link
Contributor

Does it also drops the cookie for non logged in users?

@Fedik
Copy link
Member Author

Fedik commented Apr 2, 2022

Does it also drops the cookie for non logged in users?

hm, nope, session still works as before, it just does not store "User state" in database.

@dgrammatiko
Copy link
Contributor

I have tested this item ✅ successfully on a1e36cf


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37459.

@HLeithner
Copy link
Member

Wrong approach in my opinion, we should try to create no user session if we have only a guest user. And only create the session if needed by a extension.

@brianteeman
Copy link
Contributor

Good luck with that

Co-authored-by: Brian Teeman <brian@teeman.net>
@HLeithner
Copy link
Member

Good luck with that

I wrote already a poc a while ago

@Fedik
Copy link
Member Author

Fedik commented Apr 2, 2022

@HLeithner I just extending existing feature 😉

we should try to create no user session if we have only a guest user. And only create the session if needed by a extension.

That would be better of course, but that will be much to do, and I have no idea how.
And when someone will make it, it will be not hard to remove current "option".

@HLeithner
Copy link
Member

true, other thing isn't select box with 3 options better?

@Fedik
Copy link
Member Author

Fedik commented Apr 2, 2022

true, other thing isn't select box with 3 options better?

I not sure.
Then probably I need to change the session_metadata value type to integer, that tehnically will be b/c. It is boolean currently.

@simbus82
Copy link
Contributor

simbus82 commented Apr 2, 2022

This should improve performance for sites that does not use User registration/login feature.

I'm really interested in this aspect, performance. In case of many visitors then this solution can improve the performances avoiding the work due to the creation of the sessions ... correct?
What side effects, if any, will there be compared to the current CMS behavior for guests?

Thanks!

@HLeithner
Copy link
Member

I'm really interested in this aspect, performance. In case of many visitors then this solution can improve the performances avoiding the work due to the creation of the sessions ... correct? What side effects, if any, will there be compared to the current CMS behavior for guests?

Thanks!

sadly not, it only allow to disable metadata for guest users, you can disable metadata for all users if you like then no addition database query for updating the stats will be done. But still Joomla creates a Session for each user (request without session)

@martin-zw
Copy link

I have tested this item ✅ successfully on b2d406e


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37459.

@joeforjoomla
Copy link
Contributor

joeforjoomla commented Apr 28, 2022

I have tested this item 🔴 unsuccessfully on b2d406e

The new parameter is not b/c because it's set by default to 0 and it's disabled by default. This causes to lose metadata for guest users by default causing b/c issues to extensions relying on these data also for guest users.
The parameter must be '1' enabled by default.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37459.

@Fedik
Copy link
Member Author

Fedik commented Apr 29, 2022

I have changed to enabled by default, test again

@martin-zw
Copy link

I have tested this item ✅ successfully on 99e7bb9


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37459.

1 similar comment
@joeforjoomla
Copy link
Contributor

I have tested this item ✅ successfully on 99e7bb9


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37459.

@alikon
Copy link
Contributor

alikon commented May 2, 2022

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37459.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.