---
title: "Discussion on \"Offline Sound Buttons with a Service Worker: Caching Audio, Handling Range Requests and Staying Inside Storage Limits\" | Hashnode"
description: "Discussion on \"Offline Sound Buttons with a Service Worker: Caching Audio, Handling Range Requests and Staying Inside Storage Limits\". A soundboard is a great candidate for offline support. The clips are small, they don't change once published, and people use them in places with bad signal: a bus, a basement, the back of a classroom."
url: "https://hashnode.com/posts/offline-sound-buttons-with-a-service-worker-caching-audio-handling-range-requests-and-staying-inside-storage-limits/6ad344e43f4fda01996a5c2a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Offline Sound Buttons with a Service Worker: Caching Audio, Handling Range Requests and Staying Inside Storage Limits](https://abidali671.hashnode.dev/offline-sound-buttons-with-a-service-worker-caching-audio-handling-range-requests-and-staying-inside-storage-limits?utm_source=hashnode&utm_medium=feed)

A soundboard is a great candidate for offline support. The clips are small, they don't change once published, and people use them in places with bad signal: a bus, a basement, the back of a classroom.

Oct 17 · 8 min read · abidali671.hashnode.dev  
Read the article

-   [#service-worker](https://hashnode.com/tag/service-worker)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#pwa](https://hashnode.com/tag/pwa)
-   [#webdev](https://hashnode.com/tag/webdev)
-   [#frontend](https://hashnode.com/tag/frontend)

## Written by

[Abid Ali](https://hashnode.com/@abidali671)

@abidali671 · Karachi, Pakistan

  
[View profile](https://hashnode.com/@abidali671)

Full Stack Developer | Next.js, React, TypeScript | Building OG Scope, Digital Dialogue & Meme Tap

I'm Abid Ali, a full stack developer from Karachi with 3+ years of experience in TypeScript, Next.js, Gatsby, React and React Native. I build web apps, mobile apps and interactive UIs with solid API integration. Side projects: OG Scope (ogscope.pk), a free Open Graph checker; Digital Dialogue (digitaldialogue.pk), freelancing guides for Upwork and Fiverr beginners; and Meme Tap (memetap.pk), a free browser meme soundboard.

## Responses 1

Markdown supported · ⌘↵ to post

[StackShortlist](https://hashnode.com/@veristria)

[Oct 17](https://hashnode.com/posts/offline-sound-buttons-with-a-service-worker-caching-audio-handling-range-requests-and-staying-inside-storage-limits/6ad344e43f4fda01996a5c2a/comment/6ad345c72a069181031752e6)

The range request section is the useful part here. Answering an audio element's Range: bytes=0- request with a full cached 200 is an easy mistake, and slicing the stored buffer into a 206 keeps seeking working. Splitting favourites into their own cache that never gets auto-trimmed is a nice touch too.
