ETag HTTP header yog dab tsi?
ETag HTTP header yog dab tsi?

Video: ETag HTTP header yog dab tsi?

Video: ETag HTTP header yog dab tsi?
Video: Optimistic Concurrency in an HTTP API with ETags & Hypermedia 2024, Kaum ib hlis
Anonim

Cov ETag teb taub hau yog ib tug identifier rau ib tug tshwj xeeb version ntawm ib tug kev pab. Nws cia caches ua haujlwm tau zoo dua thiab txuag bandwidth, vim tias lub vev xaib server tsis tas yuav rov xa cov lus teb tag nrho yog tias cov ntsiab lus tsis hloov pauv.

Ib yam li ntawd, nws raug nug, ETag txhais li cas?

entity tag

Tsis tas li ntawd, kuv yuav tau txais tus nqi ETag li cas? Tsim tus nqi ETag Cov txheej txheem feem ntau ntawm nws pib-tiam suav nrog siv hash ntawm cov ntaub ntawv cov ntsiab lus lossis tsuas yog hash ntawm lub sijhawm hloov kho kawg. Cov hash generated yuav tsum tsis muaj kev sib tsoo. Hash-Collision yog qhov xwm txheej thaum ob lossis ntau qhov kev nkag mus rau hash muaj nuj nqi muab tib qhov tso zis.

Ib yam li ntawd, koj tuaj yeem nug, ETag tsim tawm li cas?

ETag tiam Txoj kev uas ETags yog tsim tawm yeej tsis tau teev nyob rau hauv HTTP specification. Hom kev ntawm ETag tiam muaj xws li siv kev sib tsoo-tiv thaiv hash muaj nuj nqi ntawm cov peev txheej cov ntsiab lus, hash ntawm lub sijhawm hloov kho zaum kawg, lossis txawm tias tsuas yog tus lej hloov kho.

ETag yog dab tsi hauv REST API?

REST thiab ETags Ib ETag (qhov chaw tag) yog HTTP cov lus teb header rov qab los ntawm HTTP / 1.1 raws web server siv los txiav txim siab hloov pauv cov ntsiab lus ntawm qhov muab URL. Peb tuaj yeem siv tau ETags rau ob yam - caching thiab conditional thov. Cov ETag tus nqi tuaj yeem xav tias yog ib qho hash xam tawm ntawm bytes ntawm lub cev teb.

Pom zoo: