Daily Learnings: Service Workers and San Jose
Painting seen at Cafe Frascatti, San Jose
Service Workers
I finally sat down and read up on Service Workers. Workers are used to run async processes. You can use them for anything you want run in the background. I was interested in using them to cache assets so your web app can still work even when offline. Workers can cache assets when your app is loaded. Then, you can set them up to intercept network requests by listening to a fetch
event and returning the cached asset if the network is not available.
Useful guides for enabling offline caching with Service Workers:
- Using Service Workers on MDN
- Progressive Web Apps with Webpack - particularly useful if you have a Webpack setup, especially when dealing with hashed asset names.
I got it working for this small kopi name generator app.
Cool spaces in San Jose
Spent the day wandering downtown. Hasn’t changed much since I was here four years ago, still very chill yet with character. Feels like coming home.
- Live Lotus is a small and very relaxing yoga space with an indie feel. Spare mats provided with showers. By far the cutest studio I have been in.
- Social Policy is a very comfortable cafe with lots of power ports. Interesting art on walls
- Cafe Frascatti is an old favorite. Opens late and has a cool upstairs loft with indie art.