You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can reproduce this problem by loading the /home page.
Expected behaviour
Fewer round trips to the database
Actual behaviour
Too many round trips to the database
Detailed description
#30040 adds the ability for admins to configure favicons. An effect of that PR is now every time the application.html.haml layout is run (on things like initial loads of /home) a series of queries are sent to the database...
All these queries are repeatedly going for one of two rows, the favicon row or the app_icon row.
These queries originate from the site_icon_path calls in the loops here.
Thanks for your report! The code indeed lacks the caching that is performed in e.g. InstancePresenter. It may make sense to move it to InstancePresenter with caching similar to the other SiteUpload objects.
Steps to reproduce the problem
You can reproduce this problem by loading the /home page.
Expected behaviour
Fewer round trips to the database
Actual behaviour
Too many round trips to the database
Detailed description
#30040 adds the ability for admins to configure favicons. An effect of that PR is now every time the
application.html.haml
layout is run (on things like initial loads of /home) a series of queries are sent to the database...All these queries are repeatedly going for one of two rows, the
favicon
row or theapp_icon
row.These queries originate from the
site_icon_path
calls in the loops here.mastodon/app/views/layouts/application.html.haml
Lines 14 to 20 in d09b02e
I don't know what the right number of queries is (I could see two, I could see zero) but this feels like too much.
Mastodon instance
Local development
Mastodon version
v4.3.0-alpha.3
The text was updated successfully, but these errors were encountered: