jimie VIP
Total posts: 531
07 Сен 2014 15:57

Hello

I`ve been doing some optimizations and found that cobalt records module is loading all easysocial .css and .js files on the pages where that module is published just to display user avatar, could you please do something about that ? there's no reason to do that, and it will reduce pagespeed, I've also played with other modules which display easysocial user avatar and they dont load all those files.

Regards

Последние изменения: 11 Сен 2014


Sergey
Total posts: 13,748
08 Сен 2014 01:04

To display avatar, we simply camm EasySocial API. And they do that there. We have no control over this behaviour.


jimie VIP
Total posts: 531
08 Сен 2014 06:02

Hello Sergey

I discussed with Mark from stackideas in skype and he said that should be happen, maybe you want to discuss with him about that ? It`s really annoying to load 3 .css files ( 400 Kbs ) and some .js file ( 300+ Kbs ) on the website if they are not used.

Rgds


Sergey
Total posts: 13,748
08 Сен 2014 10:33

jimie he said that should be happen,

Should be or shouldn't be?


jimie VIP
Total posts: 531
08 Сен 2014 10:42

Shouldn't be happen, sorry for my mistype

Rgds


Sergey
Total posts: 13,748
09 Сен 2014 02:02

We use this Foundry::document()->init();. I think this is what loads all those documents. But this is what it state in the documentation.


jimie VIP
Total posts: 531
09 Сен 2014 05:26

Here what Mark says:

[7:43:29 AM] ME: @Mark, I`ve asked Sergey about that and he said:

[7:43:33 AM] ME: " We use this Foundry::document()->init();. I think this is what loads all those documents. But this is what it state in the documentation."

[7:48:00 AM] Mark: em why does he want to use this?

[7:48:03 AM] Mark: if he use this, then it renders the js

[7:48:46 AM] ME: so instead what he need to use ?

[7:48:58 AM] Mark: em i don't know why he want to use this?

[7:49:03 AM] Mark: whats the reason for him using this?

[7:49:11 AM] Mark: if he use this, the purpose is to render the css and js

[7:49:12 AM] ME: i dont know

Regards


jimie VIP
Total posts: 531
09 Сен 2014 06:50

I digged more inside this and in this file:

library/php/community/com_easysocial/com_easysocial.php

You have:

``` php function getName($id, $name, $section) { Foundry::document()->init();

```

In my case i don't use easysocial private messages, maybe you just need to add a check to see if private messages are disabled in easysocial and if it`s disabled then stop using Foundry::document()->init();

Rgds


Sergey
Total posts: 13,748
11 Сен 2014 01:00

Done.

Работает на Cobalt