i've been looking again at using jsdelivr to speed up my site (https://github.com/jsdelivr/jsdelivr) and noticed that elgg isn't in the list of hosted files. so i'm wondering if the core devs are interested in submitting elgg files that are candidates to be distributed via jsdelivr to their repo?
i'm thinking that elgg's JS files could be hosted there and other files possibly too.
i'm also wondering what would be the most efficient syntax to use to redirect elgg to use the CDN versions of files such as Jquery and other libraries that i am using. has this been tested with requireJS and elgg by anyone here? i think i recall some discussion of support for CDN functionality in elgg by the core coders here, but i'm not seeing any options in the admin area for that. does anyone have any comment in this direction?
thanks
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- enRaiser@enraiser
enRaiser - 0 likes
- ura soul@tunist
ura soul - 0 likes
- enRaiser@enraiser
enRaiser - 0 likes
- ura soul@tunist
ura soul - 0 likes
- ura soul@tunist
ura soul - 1 like
- Cim@manacim
Cim - 1 like
- Steve Clay@steve_clay
Steve Clay - 0 likes
- enRaiser@enraiser
enRaiser - 1 like
- ura soul@tunist
ura soul - 0 likes
- ura soul@tunist
ura soul - 0 likes
You must log in to post replies.I want to know more about CDN, is there a CDN where I can put static files for my projects, all JS and images ??
for elgg its is quite possible, but it will be hack. (just search for elgg_register_js,
for example lets say jquery ...
elgg_unregister_js('jquery');
elgg_register_js('jquery','http://code.jquery.com/jquery-2.1.4.min.js', 'head');
i have just used the free jsdelivr CDN to replace most of the core elgg JS files and some of my own added ones too. the site now runs significantly quicker and especially in areas further away from my server, geographically.
it would be really great to get the elgg core and plugins loaded into jsdelvr. any core coders got a comment on that?
i think jsdelivr can be used to host your own private projects too, but i don't know all the details yet.
I tried with ELGG2.0 but has to undo it because there were some JS error because the latest JS are loaded through requireJS.
if you setup the calls to the remotely hosted JS files correctly, there will be no problem with requireJS. i even have requireJS coming from jsdelivr too now.
here's an explanation of the backend of jsdelivr (though this won't help with getting it to work on your site): https://www.maxcdn.com/blog/load-balancing-multiple-cdns-jsdelivr-works/
all you need do to use the jsdelivr version of the elgg jquery files (for elgg 1.12.x) is put this code in your theme's start.php file: ;)
you can just change the version numbers to appropriate ones if you are using an older version of elgg.
Thanks for the code snippet ura! Any performance tips are always appreciated!
@ura Sadly you can't use the distributed jQuery UI in 2.0. We have to wrap it in a closure that hides AMD so we can define it synchronously. Mixing synchronous scripts with AMD has been a huge headache, hopefully we can move all async in 3.0.
yes, I have removed this hack from my 2.0 instance. However I dont need it even, since I have registered to cloufire it takes care of static files anyway.
@steve - that's unfortunate, since it is the biggest JS file. i don't know much about the change you are referring to and don't really know enough about it all to comment.
3.0? lol.. does that have a date?