Ok I am optimizing my website..
I would like to replace the jquery script loaded from the zp-core folder with the one from the CDN to reduce load time
http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.jsSince a lot of sites use this URL the script will probably be already cached.
How can I change `zp_apply_filter('theme_head')`?
I guess I have to use a custom `my_printZenJavascripts()` in my templates functions.php and than register the filter with `zp_register_filter('theme_head','my_printZenJavascripts',0);`
Question is.. where should I do this.
Also would like to know if this is a good idea after all. I guess ZP guarantees compability with the install and the current version, so updating ZP and it might not work with the Jquery version if I forget to update?
Comments
Actually there is no way to disable loading of jQuery on the theme unless you remove the theme_head filter. If you do you might also loose other functionality as all extra scripts and other stuff are loaded via that (the backend is of course not affected). But otherwise you would load jQuery double.
For the usage of the filter look at official plugins like the html_meta_tags one for example.
I doubt that that single jquery file really causes load times issues as it is cached by the browser anyway. I know placing stuff on several hosts is a recommendation for site speed up but actually it is alway external servers like ads, embedded vides and such that seem to slow down sites.
I know the JS is cached. It's just the first visit that the 100Kb has to load..
Thanks for the explanation acrylian.
The reason it is recommend to put parts of a site on high traffic sites is that browser have a limit of http request per domain/server (as you probably know) you can exceed that way.
I however have sent sbilliard a mail to discuss an option to not load the base jQuery stuff optionally (so theme authors can choose if they really need to). So maybe we add that some time.