Riza Fahmi is the Curriculum Director of Hacktiv8, a company he started with Ronald Ishak, in an attempt to solve the developer hiring crunch that has hindered the growth of many aspiring tech startups in Indonesia. Through a 12-week immersive curriculum offered through Hacktiv8, aims to raise the quality of web developers and connect them with the best tech companies in the country.
Knowledge sharing is deeply engrained with his passion and is evident through involvement in many initiatives such as becoming a lecturer at Universitas Budi Luhur; becoming an organizer for JakartaJS, Meteor Jakarta and React Indonesia; a speaker at Singapore Elixir Meetup, GeekCamp, Lambda Jakarta and much more to come.
***
This slide was shared at Tech in Asia Product Development Conference 2017 (PDC'17) on 9-10 August 2017.
Get more insightful updates from TIA by subscribing techin.asia/updateselalu
44. Caching Strategy - Cache Only
//service-worker.js
self.addEventListener('fetch', function (event) {
// If a match isn't found in the cache, the response
// will look like a connection error
event.respondWith(caches.match(event.request))
})
45. Caching Strategy - Network Only
self.addEventListener('fetch', function (event) {
event.respondWith(fetch(event.request))
// or simply don't call event.respondWith, which
// will result in default browser behaviour
})
46. Caching Strategy - Cache, failing back to network
//service-worker.js
self.addEventListener('fetch', function (event) {
event.respondWith(
caches.match(event.request).then(function (response) {
return response
|| fetch(event.request)
})
)
})