Difference between revisions of "Zimit"

Jump to navigation Jump to search
343 bytes added ,  16:32, 23 May 2023
no edit summary
Line 56: Line 56:
* SW handle the URL, it does:
* SW handle the URL, it does:
** Find the rigth collection (base on book name)
** Find the rigth collection (base on book name)
** make coll.handleRequest
** make [https://github.com/webrecorder/wabac.js/blob/main/src/collection.js#L56 coll.handleRequest]
*** does `getReplayResponse`
*** does `[https://github.com/webrecorder/wabac.js/blob/main/src/collection.js#L275 getReplayResponse]`
**** does store.getResource()
**** does [https://github.com/webrecorder/wabac.js/blob/main/src/remotewarcproxy.js#L21 store.getResource()]
***** Do a request for `H/URL` and if not found, generate "fuzzy url" and do request `H/fuzzyurl` for each fuzzy url.  Once it found a `H/url` it stops. If it doesn't found a header return null
***** Do a request for <code>H/url</code> and if not found, generate "fuzzy url" and do request <code>H/fuzzyurl</code> for each fuzzy url.  Once it found a <code>H/(fuzzy)url</code> it stops. If it doesn't found a header return null
***** If header is revisit, resolve it (by doing another request to `H/target_url`
***** If header is a revisit, resolve it (by doing another request to <code>H/target_url</code>)
***** At the end, get the payload by doing `A/final_url`
***** At the end, get the payload by doing <code>A/final_url</code>
***** Build a ArchiveResponse with header and payload
***** Build a <code>ArchiveResponse</code> with header and payload
*** insert js script loading wombat in the html content.
*** insert js script loading wombat in the html content.
*** rewrite the ArchiveResponse content.
*** rewrite the ArchiveResponse content.
*** merge header from ArchiveResponse into the SW response ("range", "date", "set-cookis", ...)
*** merge headers from ArchiveResponse into the SW response (<code>range</code>, <code>date</code>, <code>set-cookies</code>, ...)
*** return response to iframe
*** return response to requester


   
   
Line 72: Line 72:
Wombat is loaded in all pages as a web worker. Js code is wrapped in a wombat context which rewrite outgoing url (fetch/location changes/...) before doing the request itself.
Wombat is loaded in all pages as a web worker. Js code is wrapped in a wombat context which rewrite outgoing url (fetch/location changes/...) before doing the request itself.


=== Comparaison with pywb. ===
=== Comparison with pywb. ===
The workflow of pywb (with a WARC archive) is almost the same but with small simplification as the rewriting part and fuzzymatching is made by the server itself without serviceworker.
The workflow of pywb (with a WARC archive) is almost the same but with small simplification as the rewriting part and fuzzymatching is made by the server itself without serviceworker.


31

edits

Navigation menu