By User on Friday, 26 February 2021
Replies 9
Likes 0
Views 1.3K
Votes 0
Hello. I can't use on site "Enable Automated Archiving" because nobody will see story posts.

So I'm ingesting, will my site works faster if to unpublished some stream items with SQL query? For example I can unpublish some core items about friendship, following, user joined cluster, user joined site...

At the moment:
e2gr3_social_stream = 154 463+
e2gr3_social_stream_item = 218 164+

Community page loads very slow https://strana-krovi.com/community

In e2gr3_social_stream_item I should set state = 0 (instead 1) if verb = leave (leave cluster I mean), = follow, = join, = register, = add (friend)

Similar should be done for e2gr3_social_stream?

Also in backend I can unpublish few "User Points" and it will prevent creating new stream items in future (but will not hide existed)?

But will it make site faster?

Thanks.
Hello,

So I'm ingesting, will my site works faster if to unpublished some stream items with SQL query? For example I can unpublish some core items about friendship, following, user joined cluster, user joined site...


Regarding the above, I am afraid unpublishing these records from your stream table might not boots the query performance since those unpublished records still in the table and SQL still need to filter out these unpublished records.

If you want to optimise your stream table, your best bet is to archive your old stream items so that the your stream tables become small which eventually give better SQL performance. In my opinion, no one will be interested with the outdated story posts?

If archiving your stream table is not an option, then I suggest you to delete the story posts that you think is not important. Like the friendship, following, user joined cluster and etc. You may run below queries to delete these stream items.



-- following items

delete a, b
from #__social_stream as a
inner join #__social_stream_item as b on a.id = b.uid
where a.context_type = 'followers'
and a.verb in ('follow');




-- adding friends

delete a, b
from #__social_stream as a
inner join #__social_stream_item as b on a.id = b.uid
where a.context_type = 'friends'
and a.verb in ('add');


-- joined group

delete a, b
from #__social_stream as a
inner join #__social_stream_item as b on a.id = b.uid
where a.context_type = 'groups'
and a.verb in ('join');




-- liked page

delete a, b
from #__social_stream as a
inner join #__social_stream_item as b on a.id = b.uid
where a.context_type = 'pages'
and a.verb in ('like');



-- attending event

delete a, b
from #__social_stream as a
inner join #__social_stream_item as b on a.id = b.uid
where a.context_type = 'guests'
and a.verb in ('going');


Please backup your database first before you run these SQL and remember to replace #__ to your Joomla table prefix.

Hope this help and have a nice day
Sam
·
Friday, 26 February 2021 12:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello. Thanks for help.
Is it possible to create SQL queries to manually archive only friendship, following, user joined cluster and etc.? Thanks.
·
Friday, 26 February 2021 12:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

I am sorry but you will need to create a script to archive these records as archiving data involve multiple operation.
You may consider to send us customisation request to create such script for you.

https://stackideas.com/customization-works
Sam
·
Friday, 26 February 2021 14:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi User
Try disabling the side modules in https://strana-krovi.com/community one at a time. Or all at once. The server response of 5 seconds is an anomaly. I think it's related to modules. Because on the mobile version, the response is no more than 500 ms. There are simply no side modules. On other pages, it seems to me that the side modules also slow down a little.
·
Tuesday, 02 March 2021 05:56
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Kirill,

Thanks for sharing your tips.

Moving this thread to Tips & Tricks section so that more tips can be shared by the community members.
Sam
·
Tuesday, 02 March 2021 10:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Try disabling the side modules in https://strana-krovi.com/community one at a time. Or all at once. The server response of 5 seconds is an anomaly. I think it's related to modules.
Thanks. I unpublished it all and tested speed with separated modules. Every modules add extra mili/seconds.
EasySocial Social Goals
EasySocial Groups
EasySocial Recent Polls
EasySocial Users – display about 60+ online users at the same time.
EasySocial Leader Board – but this module is the most problematic. Like the Leaderboard page https://strana-krovi.com/leader (21.18 sec).
Hm. What can be done? Seems I should create another ticket. ?‍♂️ But I suppose there is nothing to do because there is lots of users?

At the moment I published only EasySocial Users and community page loads about 1.19 sec.
·
Tuesday, 02 March 2021 20:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi
1. Override the template.
2. In the template code, add the commands for the browser decoding="async" loading="lazy"

/html/com_easysocial/helpers/avatar/user.php


<img src="<?php echo $avatar;?>" alt="<?php echo $this->html('string.escape', $user->getName());?>" width="<?php echo $width;?>" height="<?php echo $height;?>" />
<?php if ($anchorLink) { ?>



<img decoding="async" loading="lazy" src="<?php echo $avatar;?>" alt="<?php echo $this->html('string.escape', $user->getName());?>" width="<?php echo $width;?>" height="<?php echo $height;?>" />
<?php if ($anchorLink) { ?>


3. Make sure that server-side caching is enabled for js, css, and images.

Modules create a large load, they need to be optimized and used only if they are very necessary. On other pages of the site, the same thing... the modules slow down a lot.
Well, plus js and database optimization... there are already feature requests about this.
·
Wednesday, 03 March 2021 00:36
·
0 Likes
·
0 Votes
·
0 Comments
·
hi Mark, what are the plans to optimize page load in the future?
for me as non dev it looks not really hard to optimize the modules with tweaks like this from Kirill.
or i followed this discussion too, what is also a good read:
https://stackideas.com/forums/performance-measurement-defer-javascript

i understand of course that any change to the code must be carefully considered, however i think that you could put such optimizations on your own test bench or?
·
Wednesday, 03 March 2021 01:15
·
0 Likes
·
0 Votes
·
0 Comments
·
EasySocial Leader Board – but this module is the most problematic. Like the Leaderboard page https://strana-krovi.com/leader (21.18 sec).


Yes, there is something wrong with this module...

and there is a small error, maybe you should create a ticket
/modules/mod_easysocial_leaderboard/tmpl/default.php

<div class=es-leader-context__info>
<?php echo $lib->html('html.user', $user);?>
<div class="mod-es-leader__points"><?php echo JText::sprintf('MOD_EASYSOCIAL_LEADERBOARD_USER_POINTS', $user->getPoints());?></div>
</div>


<div class=es-leader-context__info> no quotation marks for the class
·
Wednesday, 03 March 2021 01:28
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post