|
I've been playing around with Javascript loaders. I'm currently in Australia with crap bandwidth so it's a great opportunity (I tell myself) to test loading speed.
The prevailing wisdom is never use the blocking document.write for loading scripts. Also, always, have scripts in the HEAD, not the body. And floss twice a day. And never walk under a ladder, it'll give you bad luck.
Basically web optimisation is like search engine optimisation: lots of rules, lots of old wives tales, sometimes actual data, and more often than not it's totally and utterly out of date.
HeadJS is a loader and they provide an excellent test page for a script loaded at the top, at the bottom of a page, and via HeadJS. It's meant to show HeadJS is way faster. Which it is in IE and Edge.
In Chrome, Firefox, Opera and Safari HeadJS is dramatically slower. Browsers continue to improve and the hacks we use one year are completely unnecessary (and sometimes detrimental) the next year.
Unless you're on IE or Edge.
Isn't it about time they simply joined forces with WebKit or even Blink and just helped the world have a single, fast, compatible browser? They've embraced everything else.
cheers
Chris Maunder
|
|
|
|
|
But Edge is 'cutting'. How can you not respect its authoritah?
So much for sarcasm. How the heck could anyone use a browser that doesn't offer a way to right click a tab to the front? (Without holding 'shift'.) Couldn't be done even with their version of extensions the last time I checked.
|
|
|
|
|
MS will never join any standard they can't dominate (and proceed to bend to 'their' way)
sin tak ear lol
press the "Any" key may be continuate
|
|
|
|
|
Chris Maunder wrote: Basically web optimisation is like search engine optimisation: lots of rules, lots of old wives tales, sometimes actual data, and more often than not it's totally and utterly out of date
Don't forget the mandatory large helping of pure unadulterated luck.
Cheers,
Mick
------------------------------------------------
It doesn't matter how often or hard you fall on your arse, eventually you'll roll over and land on your feet.
|
|
|
|
|
What I take away from this is that HeadJS is the problem in this anecdote.
This space for rent
|
|
|
|
|
See? This is why it's no fun having mindless rants to smart people.
Facts: be careful they don't get in the way of a good story.
cheers
Chris Maunder
|
|
|
|
|
Warning: Recursion Ahead.
Chris Maunder wrote: Facts: be careful they don't get in the way of a good story. I'm glad I posted that.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Chris Maunder wrote: I'm currently in Australia...
So you can drop by and pay me in beer for beating the filter without trying last Friday.
Michael Martin
Australia
"I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible."
- Mr.Prakash One Fine Saturday. 24/04/2004
|
|
|
|
|
Chris Maunder wrote: Also, always, have scripts in the HEAD, not the body.
Is that a recent change? The recommendation always used to be to have the script tags as close as possible to the end of the body, so you didn't hold up the rendering process whilst the external scripts were being downloaded.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming wrote: script tags as close as possible to the end of the body, so you didn't hold up the rendering
I thought the same thing. For whatever it's worth, Yahoo has guidelines that talk about this:
Best Practices for Speeding Up Your Web Site - Yahoo Developer Network[^]
But, maybe it changed in the last 12 seconds. Rules of the web change with every release of (Chrome, IE, Edge, Safari, Firefox, Opera) which is every 12 seconds.
|
|
|
|
|
This is old, old dogma from back when Edge wasn't even a sparkle in IE's eye.
cheers
Chris Maunder
|
|
|
|
|
So you don't use IE/Edge because they load JS faster?
|
|
|
|
|
I must not have explained well enough:
IE/Edge load faster if your use HeadJS. ie you need to actively work to get the script to load faster than if you'd just included scripts as per standard operating procedures.
All other browsers load fast. Using the bootstrap actually slows things down. As one would hope / expect.
Actually, I don't use Edge because everytime I do a major Windows update, Edge goes back to being the default, and I'm petty and hold grudges, so I make a point of turning all that off (again) and using something else.
That's right: deep down I'm 5 years old.
cheers
Chris Maunder
|
|
|
|
|
Aah, now I understand. Everything about this issue.
|
|
|
|
|
I've received my stickers, all the way from the Great White North,eh.
Bob is in the house!
http://raddev.us/images/cp/codey.jpg[^]
CodeProject is a fantastic community. Keep up the great work.
|
|
|
|
|
Awesome. But keep him inside. I put one on my car and he didn't take it well.
|
|
|
|
|
Good to know. Thanks
|
|
|
|
|
You got stickers? I didn't get any stickers
|
|
|
|
|
@sean-ewingtonn: Can you please get this man a sticker, stat!
cheers
Chris Maunder
|
|
|
|
|
Awesome. I am too awaiting Bob's arrival to my home in this festive season in India
___@sHubHa
|
|
|
|
|
Aren't you running the risk of hiding important information, placing stickers right on your monitor's screen like that...
|
|
|
|
|
I was wondering who would be the first to notice that I stuck them straight on the monitor.
It's a little difficult at times, but mostly they don't bug me.
|
|
|
|
|
Sure, you did.
Do you also have white-out on your monitor?
|
|
|
|
|
|
Nish Nishant wrote: Feel sorry for the people who bought it, hoping to write apps for it.
Give them a box of Band-aids to cover their wounds.
|
|
|
|