Salutare si La Multi Ani tuturor !
Pentru ca Google tine cont din ce in ce mai multe de experienta utilizatorului, m-am apucat de imbunatatirea vitezei de incarcare pentru paginile unui site. Problema la care m-am blocat se numeste Defer parsing of JavaScript. Un test cu page speed imi spune ceva de genul:
+ alte cateva fisiere de acelasi gen pe care le-am eliminat din cod.Cod:438.0KiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering. * http://www.site.com/wp-content/plugins/wp-minify/min/?f=wp-includes/js/jquery/jquery.js,wp-content/plugins/upprev/scripts/upprev.js,wp-includes/js/tw-sack.js,wp-content/themes/succes/scripts/jquery-1.3.1.min.js,wp-content/themes/succes/scripts/tabs.js,wp-content/themes/succes/scripts/clear-input.js,wp-content/themes/succes/scripts/jquery.cookie.js,wp-content/themes/succes/scripts/jquery.textarearesizer.js&m=1324422196 (134.6KiB) * https://plus.google.com/_/apps-static/_/js/widget/googleapis_client,iframes_styles_bubble_internal/rt=j/ver=amgm7Ud-ETk.en./sv=1/am=!itqi7GDL5S6I4GqN1g/d=1/ (85.3KiB) * http://s7.addthis.com/js/300/addthis_widget.js (84.9KiB) * https://plusone.google.com/_/apps-static/_/js/plusone/p1b,p1p/rt=j/ver=lDxI1lXYCNQ.en_US./sv=1/am=!Aaw9TR0V_JYI_rVq/d=1/ (44.9KiB) * http://s7.addthis.com/static/r07/sh70.html (35.1KiB of inline JavaScript) * http://platform.twitter.com/widgets/hub.1324331373.html (17.7KiB of inline JavaScript) * http://platform.twitter.com/widgets/tweet_button.1324331373.html (17.4KiB of inline JavaScript) * http://pagead2.googlesyndication.com/pagead/show_ads.js (9.7KiB) * http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.site.com%2Fnumele-paginii.html&layout=button_count&show_faces=false&width=100&action=like&font=arial&layout=button_count (2.4KiB of inline JavaScript) * http://www.site.com/numele-paginii.html (1.3KiB of inline JavaScript) * http://www.google.com/cse/brand?form=cse-search-box〈=en (944B) * https://plusone.google.com/_/+1/fastbutton?url=http%3A%2F%2Fwww.site.com%2F2Fnumele-paginii.html&size=medium&count=true&annotation=&hl=en-US&jsh=m%3B%2F_%2Fapps-static%2F_%2Fjs%2Fwidget%2F__features__%2Frt%3Dj%2Fver%3Damgm7Ud-ETk.en.%2Fsv%3D1%2Fam%3D!itqi7GDL5S6I4GqN1g%2Fd%3D1%2F (728B of inline JavaScript) * http://pagead2.googlesyndication.com/pagead/js/r20111207/r20110914/abg.js (700B) * http://pagead2.googlesyndication.com/pagead/js/r20111207/r20110914/abg.js (700B)
Datorita faptului ca nu sunt programator nu am reusit sa rezolv problema desi am citit ceva documentatie. Banuiesc ca problema se poate rezolva cu atributul defer insa implementarea lui ma depaseste.
Iata si ce spune Google referitor la aceasta problema:Cod:<script type="text/javascript" src="foo.js" defer="defer"></script>
In our own tests conducted in early 2011, we found that on modern mobile devices, each additional kilobyte of JavaScript adds about 1ms of parse time to the overall page load time. So 100kB of JavaScript included in the initial page load would add 100ms of load time for your users. Because JavaScript must be parsed on every visit to a page, this added load time will be part of every page load, whether loaded from the network, via the browser cache, or in HTML5 offline mode.
Ceva idei despre cum se poate rezolva efectiv aceasta problema ? Multumesc anticipat !![]()




Răspunde cu citat