By Ineke Huibregtse on Tuesday, 04 February 2014
Posted in Technical Issues
Replies 11
Likes 0
Views 777
Votes 0
Hi,
On our homepage we have a module with latest blogs. When loading the homepage in the browser a rather large script file is loaded (media/com_easyblog/scripts/easyblog-3.9.15188.static.min.js) of 418 KB. With almost 30,000 visits a month, most of them entering through the homepage, this script on its own causes more then 12 GB traffic every month. I was wondering if it is possible to do this in a more efficient way?
Best!
Ineke
Hello Ineke,

Do you have ratings enabled on the module? If you don't use it, you should turn that off so the scripts don't need to get loaded on the front page of the site.
·
Tuesday, 04 February 2014 22:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Mark,
In de component settings, all rating options are set to "no". They already were... Also in the module the ratings already were disabled.
So, I'm afraid that didn't solve it. Hope you have other options?
Best
Ineke
·
Wednesday, 05 February 2014 15:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Ineke,

Hm, that is odd. Can you please provide us with the back end and FTP access to the site to check on this?
·
Wednesday, 05 February 2014 17:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,
Here it is. thank you!
·
Wednesday, 05 February 2014 17:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Ineke,

Can you give this a try again?
·
Wednesday, 05 February 2014 18:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,
It's gone on the homepage! Thank you. The homepage went down form 2.6 to 1.5 MB, which is great.
How did you do that? Will the module still work, and refresh content?
The script does still load when I open a page of a blogger e.g. http://lotjeenco.nl/blogs/silvie/categories/listings/silvie
Is it needed there, but not on the homepage?
Best
Ineke
·
Wednesday, 05 February 2014 18:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes, those are actually needed because that is the main javascript file which is used in our extensions. It is necessary but since the module on your front page don't really need it, I have disabled it for you

If you are hitting close to 30,000 hits on the blogger's page, then I do think it's acceptable because people are browsing and interacting on your site which also means that it is worthwhile to invest 12GB on the bandwidth
·
Wednesday, 05 February 2014 18:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,
Yes you are right, and we shouldn't complain if 30,000 read the blogs every month... But the more economic homepage makes me quite happy!
Could you enlighten me about how you disabled the script on the homepage? I assume it's update-proof? I'm curious how it works (and yes, also a bit of a control freak
·
Wednesday, 05 February 2014 18:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Ineke,

It's not really a bug per-se as it's more towards optimizations. If ratings is disabled in the module, there's no point loading the javascript on the page since nothing from that module utilizes javascript. What I did to fix this was to edit the file /modules/mod_latestblogs/mod_latestblogs.php and removed the codes below:


EasyBlogHelper::loadHeaders();
·
Wednesday, 05 February 2014 21:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,
So, should I put this file in an override?
Thank you for the information!
Ineke
·
Wednesday, 05 February 2014 21:57
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Ineke,

You can't actually override the main module file because you can only override the template files of a module. I will add a check for the module in the future so that if ratings is disabled, it will not render the JS libraries
·
Wednesday, 05 February 2014 23:22
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post