Welcome Guest, Not a member yet? Register   Sign In
Problem with using jquery
#11

[eluser]boltsabre[/eluser]
As mentioned by Samus, you really should just use the google hosted files. This has a few added benefits including:
- Decreased page load speeds/times (depending on your site it could greatly decrease the amount of time, or only marginally, but either way it's a good idea).
- Reduced downloads from your server if you have a plan with a monthly download limit or pay per mb/gb of downloads.
#12

[eluser]kingmaoam[/eluser]
Hi,

the fact with reducing the amount of data downloaded from my server is clear, but how do the hosted files increase load speed of my page?
#13

[eluser]mineroad[/eluser]
The Google hosted files are used by many other websites. Because of that it is normally already cached in your end user's browser. Having the files cached decreases load time because they don't need re-download the code again when using your website. Even if the files aren't already cached Google's content delivery network is going to be faster than your server when delivering the files.
#14

[eluser]Samus[/eluser]
[quote author="mineroad" date="1345471192"]The Google hosted files are used by many other websites. Because of that it is normally already cached in your end user's browser. Having the files cached decreases load time because they don't need re-download the code again when using your website. Even if the files aren't already cached Google's content delivery network is going to be faster than your server when delivering the files.[/quote]
this!

[quote author="kingmaoam" date="1345468849"]Hi,

the fact with reducing the amount of data downloaded from my server is clear, but how do the hosted files increase load speed of my page?[/quote]
well it doesn't actually increase the load speed of your page exactly. if you have a slow page with lots of data your page is going to be slow anyway. it just increases the load speed of jquery loading into your page.
#15

[eluser]kingmaoam[/eluser]
ok got it :-)

Thanks for the help so far...
Could be I have another issue in the next days ;-)

KR
Habib
#16

[eluser]boltsabre[/eluser]
Quote:well it doesn’t actually increase the load speed of your page exactly. if you have a slow page with lots of data your page is going to be slow anyway. it just increases the load speed of jquery loading into your page.

That's not quiet true, it's got to do with how many assets your browser can download at any one given time from one server (generally 8 is the limit I think). So that means that if you host the file yourself, you're stopping the browser from downloading other assets until it has fully downloaded the jQuery file (even if the browser has already cached the file, it still sends a http request to see if the file has changed unless you've specified a expire date).

This has a flow on affect right down the chain. Reducing the number of http requests both in the total overall number, and from individual servers, can speed up page load greatly. That is why many sites will host their images on a separate server - that way the browser can simultaneously download asset files (css, js, etc) AND images (such as your logo, sprites, etc).
#17

[eluser]kingmaoam[/eluser]
Hi boltsabre
According to this I have a question...
If i put my Images to a Folder reachable by another subdomain of my Server, does this count as another Server for the Browser?
#18

[eluser]boltsabre[/eluser]
To be honest, I've never looked at this from the perspective of a subdomain of the "main" domain... you'll have to investigate this one yourself on google. Sorry I cannot help in this matter.

But one thing to be aware of, many lower priced hosting plans will state that "image hosting" is against their TOC. This is to stop website owners paying a tiny $5 monthly fee on a low plan and using it to feed many gigabytes of "image" downloads to their main website/domain (especially if they have an image gallery with lots of high res/quality images, you can rack up a gig of image downloads very very quickly).

That said, if you don't have an img gal, you should be able to combine most of your icons, nav buttons, logos, etc into a few sprites. I did this for the website/company I currently work for and got a reduction in page load speeds of 20-30% just by reducing the number of http requests (got ride of 30-40 requests by using sprites) and some simple image optimisation (our buttons were at a 256 colour palette, I dropped them down to 16 without any quality loss, and then ran them through smushit.com, reduced most of the file sizes by 80+%).

So, whatever method you go for, good luck!!!
#19

[eluser]Otemu[/eluser]
Hi,

I just thought I add this in case your not aware, when using Google hosted libraries you could add a fallback method in the event that the library can not be accessed for whatever reason, such as when viewing the site on your local machine or Google is inaccessible or down.

Example here, if Google library fails to load then jQuery will be undefined and you can just load your local version
#20

[eluser]boltsabre[/eluser]
Nice one Otemu, very good idea!!!




Theme © iAndrew 2016 - Forum software by © MyBB