Saiti Yekumhanyisa uye Asynchronous Javascript

asynchronous

Kunyangwe ndichiita kusimudzira kwakawanda, ini handizviratidze semusimudziri wechokwadi. Ini ndinogona kuronga uye kufambisa zvinhu kutenderera pane peji uye riite kuti rishande. Mugadziri wechokwadi anonzwisisa maitiro ekuvandudza kodhi kuti igone kuyerwa, kwete kutora zviwanikwa zvakawanda, kutakura nekukurumidza, kugadziriswa zviri nyore gare gare uye zvichiri kushanda.

Nzvimbo yakaoma iyo vatengesi vanoiswa mukati ndeyekuti vese vane yakakurumidza webhusaiti uye uchiri kubatanidza kusanganisa uye zvemagariro zvinhu izvo zvinogona kuumba kutsamira pakukurumidza saiti yako saiti. Mumwe muenzaniso wakadai mabhatani emagariro. PaMartech, isu tinemagariro mabhatani pane yega yega peji pane ino saiti. Saka… kana Facebook zviwanikwa zvichitakura zvishoma rimwe zuva, zvinodzora yedu saiti. Wobva wawedzera Twitter, Pinterest, Buffer, nezvimwewo kune izvo uye yako saiti mikana yekukasira nekukurumidza inoderedzwa kuita chero chinhu.

Izvo zvinozivikanwa sekufananidza kurodha pasi. Iwe unofanirwa kupedzisa kurodha chinhu chimwe pamberi iwe unoremedza chinotevera chinhu. Kana iwe uchikwanisa kurodha zvinhu asynchronously, iwe unokwanisa kutakura zvinhu pasina kutsamira pane mumwe nemumwe. Unogona kuvandudza zvakanyanya yako saiti kumhanyisa nekuisa zvinhu asynchronously. Dambudziko nderekuti zvinyorwa-zve-mubhokisi zvinopihwa nemakambani aya hazvimbofi zvakagadziridzwa kumhanya asynchronous.
asynchronous

Unogona kuona chiri kukanganisa peji rako nekumhanyisa bvunzo paPingdom:
pingdom peji mutoro

Asynchronous Javascript inobvumidza iwe kunyora kodhi inotaurira zvinhu kutakura pashure peji racho rakazara zvakakwana. Hapana kutsamira! Saka, rako peji rinoremerwa uye kana rangozadziswa, chinyorwa chinotanga icho chinoremedza zvimwe zvinhu - mune ino kesi yedu yemagariro mabhatani. Kana iwe uri mugadziri, unogona kuverenga chinyorwa chikuru, Simbe Kuisa Asynchronous Javascript.

Heino snippet yemabatiro ekuti uzviite nemazvo kubva Emil Stenström:

(basa () {basa async_load () {var s = document.createElement ('script'); s.type = 'zvinyorwa / javascript'; s.async = ichokwadi; src = 'http://buttondomain.com /script.js '; var x = document. imwe hwindo.addEventListener ('mutoro', async_load, nhema);}) ();

Mhedzisiro ndeyekuti kana izvi zvechitatu bato zvakabatanidzwa zviri pasi kana zvichimhanya zvishoma, hazvimbokanganisa yako yepakati peji yezvinyorwa kubva pakuonekwa. Kana iwe ukatarisa kunobva peji redu, iwe uchaona kuti ini ndiri kurodha ese mamwe ekuwedzera magwaro ekushandisa ndichishandisa nzira iyi. Maitiro yakavandudza yedu saiti kumhanya masekondi - uye haidzipire panguva yekuodha. Isu hatina kushandura edu ese ekunze kutsamira ku Asynchronous Javascript, asi isu ticha.

Unofungei?

Nzvimbo iyi inoshandisa Akismet kuderedza spam. Dzidza kuti sei deta yako inoshandiswa.