pclubuiet / website

Programming club, PU official website.
https://pclubuiet.herokuapp.com
GNU General Public License v3.0
14 stars 70 forks source link

Add Service Worker #149

Closed gurpreetsingh00885 closed 6 years ago

gurpreetsingh00885 commented 6 years ago

Closes #91

Demo Link: https://gspclub.herokuapp.com/

This is a work in progress. The service worker first checks if network is available and fetches data from server if it is. Otherwise it retrieves data from cache. Everything works just the new data is not being added to the cache after it is fetched.

gurpreetsingh00885 commented 6 years ago

The cache issue is arising most probably since the cache "put" operation is being performed asynchronously. While it is being performed, the response is returned leading to fulfilment of the event and the asynchronous put operation is terminated.