1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
Commit graph

6 commits

Author SHA1 Message Date
Arunoda Susiripala 0d2af801ec Use service-worker to fetch only JSON pages. (#924)
* Use service-worker to fetch only JSON pages.
We simply don't need to proxy other requests through that.
That's might cause some latency issues.

* Use a better regexp to identify JSON pages.
2017-01-30 19:42:49 +09:00
Dan Zajdband f8986cfd92 Adding polyfill to Headers.getAll to make it work both with the current and past spec. (#723) 2017-01-10 11:42:10 -08:00
Naoyuki Kanezawa 0551dc90a1 bypass SSE on Service Worker (#681) 2017-01-06 07:23:41 -08:00
Arunoda Susiripala 37a9c661ff Make prefetching works again. (#422) 2016-12-17 13:59:03 -08:00
Arunoda Susiripala 43b0e6f514 Remove console.logs (#402) 2016-12-16 11:43:46 +09:00
Arunoda Susiripala 36abdc77c5 Prefetch pages with Service Workers (#375)
* Register the service worker.

* Update prefetcher code to do prefetching.

* Implement the core prefetching API.
support "import <Link>, { prefetch } from 'next/prefetch'"

* Implement a better communication system with the service worker.

* Add a separate example for prefetching

* Fix some typos.

* Initiate service worker support even prefetching is not used.
This is pretty important since initiating will reset the cache.
If we don't do this, it's possible to have old cached resources
after the user decided to remove all of the prefetching logic.
In this case, even the page didn't prefetch it'll use the
previously cached pages. That because of there might be a already running
service worker.

* Use url module to get pathname.

* Move prefetcher code to the client from pages
Now we also do a webpack build for the prefetcher code.

* Add prefetching docs to the README.md

* Fix some typo.

* Register service worker only if asked to prefetch
We also clean the cache always, even we initialize
the service worker or not.
2016-12-15 11:13:40 -08:00