Skip to content
This repository has been archived by the owner on Oct 13, 2022. It is now read-only.

[Offline] Ignoring query string in static files #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[Offline] Ignoring query string in static files #150

wants to merge 1 commit into from

Conversation

bekliev
Copy link

@bekliev bekliev commented Jun 8, 2019

Prerequisite

First you have to approve this PR #148 or #138 to serve cached files through service-worker.

About this PR

If you try to open static file (which has been cached), for example borat pic in the example app:

https://sapper-template.now.sh/great-success.png
It will open successfully!

But if you try to add some query strings, e.g.: ?foo=bar, then it will not work*:

https://sapper-template.now.sh/great-success.png?foo=bar
*if you approved this PR #148 or #138

So this PR solves above bug and ignores query strings.

@bekliev bekliev changed the title Ignoring query string in static files [Offline] Ignoring query string in static files Jun 8, 2019
@Rich-Harris
Copy link
Member

I made this comment on sveltejs/hn.svelte.dev#3 but it's probably more applicable here:

Thank you. I'm not certain this is what we want — aren't query string parameters often used for cache busting purposes? (I realise that it's a hacky practice)

@bekliev
Copy link
Author

bekliev commented May 16, 2020

You're right query parameters helping us to download again the file.
But in this case the file is not downloading at all - server's responding with 404 error - that's not correct in my opinion

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants