mshenfield / subreddit_algebra

A python port and frontend to 538's subreddit analysis
MIT License
5 stars 0 forks source link

Cache assets and API calls using a service worker #26

Open mshenfield opened 7 years ago

mshenfield commented 7 years ago

We already have a service worker - it's just not doing anything. We should cache assets and API requests - this could really reduce un-necessary load to the completions endpoint.

mshenfield commented 7 years ago

For /api endpoints, the main goal is to reduce calls to /api/completions and api/algebra when someone is • backspacing • retyping the same thing • swapping

This doesn't have to live for longer than their visit - is there a way to empty a service-worker cache when someone leaves the page? This is probably better to implement in an API client with an in-memory cache.

EDIT This portion was completed in de5262acdda81b1f73b566997bdd7fb0950c2361