Re: [whatwg/fetch] Generic Accept header value */* and Service Workers (#634)

Hi everyone. I'm not seeking advice or any solution for my current issue, but my use case might help motivate (if needed) implementation of `request.destination`:

I've got the issue of resources loaded via a Service Worker that have a `.gif` extension, but actually a video content type.

The reason is Cloudinary's Fetch API allows me to convert an animated GIF to a video with parameters in the middle of the URL, but the URL's end is the source GIF file. Details in my recent blog post: [Using Cloudinary’s Fetch API to convert an animated GIF to a video](https://nicolas-hoizey.com/2018/08/using-cloudinary-s-fetch-api-to-convert-an-animated-gif-to-a-video.html).

`request.destination` is not ready everywhere yet, so I wonder how I should implement my caching strategy to cache actual GIFs but not these "strange" GIFs that are actually videos.

I used to filter URLs with the images extensions (because of the generic `*/*` Accept header), but now I have to accept `.gif` while removing videos.

I added a test for the presence of `/(f_mp4|f_webm)/` in the URL (that's the Cloudinary way to transform into another *f*ormat), but this isn't very satisfactory.

`request.destination` would be perfect to solve my issue.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/634#issuecomment-410819795

Received on Monday, 6 August 2018 19:09:26 UTC