31
edits
Mgautierfr (talk | contribs) |
Mgautierfr (talk | contribs) |
||
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 | ***** 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 | ***** 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 | ***** 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 | *** merge headers from ArchiveResponse into the SW response (<code>range</code>, <code>date</code>, <code>set-cookies</code>, ...) | ||
*** return response to | *** 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. | ||
=== | === 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. | ||
edits