---
title: "Comment by StackShortlist on \"Offline Sound Buttons with a Service Worker: Caching Audio, Handling Range Requests and Staying Inside Storage Limits\" | Hashnode"
description: "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 t"
url: "https://hashnode.com/posts/offline-sound-buttons-with-a-service-worker-caching-audio-handling-range-requests-and-staying-inside-storage-limits/6ad344e43f4fda01996a5c2a/comment/6ad345c72a069181031752e6"
---

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

Comment [Offline Sound Buttons with a Service Worker: Caching Audio, Handling Range Requests and Staying Inside Storage Limits](https://hashnode.com/posts/offline-sound-buttons-with-a-service-worker-caching-audio-handling-range-requests-and-staying-inside-storage-limits/6ad344e43f4fda01996a5c2a)

[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.
