neatonk / reason-webp-sw-test

Test project implementing an service worker in ReasonML.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ReasonML WebP Service Worker Test

This repo contains a test project implementing a service worker which intercepts image requests and returns WebP images where supported. This project was created to test the use of ReasonML to create a service worker script.

Demo

git clone git@github.com:neatonk/reason-webp-sw-test.git
cd reason-webp-sw-test
make && make serve

Roadmap

  • Implement a P.O.C. service worker (in js) which intercepts image requests and responds with a WebP image where supported.
  • Translate the P.O.C service worker impl. to reason.
  • Cache response and respond from caches if already cached.
  • [-] Download and cache a full-sized WebP image, resize according to the request, and respond with the result.
  • Partially download and cache the full-sized WebP image, resize and respond.
  • Resume cached partial response and update the cache as needed.
  • Optimize the request/resize/respond code path to minimize TTFB.

License

Distributed under the ISC license.

See LICENSE.

About

Test project implementing an service worker in ReasonML.

License:ISC License


Languages

Language:OCaml 42.6%Language:JavaScript 35.2%Language:Shell 9.8%Language:HTML 7.8%Language:Makefile 4.2%Language:C++ 0.4%