SSR, gajere don " Server-Side Rendering ," dabara ce ta haɓaka gidan yanar gizo wacce ta ƙunshi samar da abun cikin HTML na shafin yanar gizon akan sabar kafin aika shi zuwa mashigin mai amfani. Wannan ya bambanta da tsarin "Client-Side Rendering"(CSR), inda mai binciken ke zazzage lambar JavaScript kuma ya gina shafin yanar gizon bayan an zazzage shi.
Tsarin da Ƙa'idar Aiki na SSR
-
Buƙatar mai amfani: Lokacin da mai amfani ya shiga gidan yanar gizon, mai binciken yana aika buƙatu zuwa uwar garken.
-
Sarrafa Sabar: Sabar tana karɓar buƙatar kuma tana sarrafa ta ta hanyar gina abubuwan HTML na shafin yanar gizon. Wannan ya haɗa da tattara bayanai daga rumbun adana bayanai, ƙirƙirar abubuwan haɗin yanar gizo, da haɗa abubuwan cikin cikakkiyar takaddar HTML.
-
Ƙirƙirar Cikakkun HTML: Bayan sarrafawa, uwar garken yana ƙirƙirar cikakkiyar takaddar HTML mai ɗauke da abubuwan da ake buƙata, bayanai, da abubuwan haɗin yanar gizo.
-
Aika zuwa Browser: Sabar ta aika da cikakkiyar takaddun HTML zuwa mazuruftan mai amfani.
-
Bayar da Shafi: Mai bincike yana karɓar takaddun HTML kuma ya sanya shi ga mai amfani. Lambar JavaScript da madaidaicin albarkatun(CSS, hotuna) ma mai lilo ana loda shi kuma yana aiwatar da shi.
Abubuwan da aka bayar na SSR
- Amfanin SEO: Injin bincike na iya fahimtar mafi kyawun yanar gizo da matsayi lokacin da aka riga an riga an yi abun ciki akan sabar.
- Nuni Mai Sauri: Masu amfani suna ganin abun ciki cikin sauri saboda an riga an yi daftarin aiki na HTML.
- Taimako don na'urori masu rauni: Abubuwan da aka riga aka yi suna inganta ƙwarewa don na'urori masu ƙarancin aiki ko haɗin kai.
- Taimako ga Masu amfani da Ba JavaScript: SSR yana ba da damar nuna sigar asali don masu amfani waɗanda ba sa amfani da JavaScript.
A ƙarshe, SSR yana haɓaka aiki da bincike na gidajen yanar gizo ta hanyar samar da abun ciki na HTML akan uwar garken kafin aika shi zuwa mai bincike. Wannan yana ba da mafi kyawun ƙwarewar mai amfani, inganta injin bincike, da haɓaka aikin gidan yanar gizon gabaɗaya.