Hi, I'm David

I'm a Web Developer

I'm a developer with a fascination for the web that can help build your ideas into an online presence.

An image of an android like person from the waist up with sunglasses and a checkered shirt.

When using service workers you may know some of the routes you want to cache, but if you want to cache some more complex resources that are requested dynamically later, and the resultant URL of the resource you want to cache is not clear up front, there is a way to get those working offline.

When I put this new blog together with Jekyll I added a service worker to the build process, generating the required URL’s to cache using liquids templating language. I was then able to include those generated links in my service workers code to save me needing to manaully update the list over time.

Checking when a user has scrolled to the end of a page can be useful for a number of different features. You may want to load more information once a user has scrolled to the end to create infinite scrolling, or find out that a user has read your whole article.

In JavaScript it can be advantageous to override the default this context when dealing with function callbacks where you want to abstract these out into their own named functions. Using a plain .bind on the end of your function can be one way of dealing with this.

If you’ve been paying attention to new technologies on the web one thing you have not missed is Service Workers. They’re a new take on the idea of progressive enhancement and I think they’re going to stick around for a while yet.

You can find more posts here.