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

How to not cache external static files? #19

Open
rafaelpatro opened this issue Feb 7, 2018 · 2 comments
Open

How to not cache external static files? #19

rafaelpatro opened this issue Feb 7, 2018 · 2 comments

Comments

@rafaelpatro
Copy link

Hi guys!
Thanks by this project. It's simple but very useful.

My store loads some static files from external sources. And that is being cached by the "service worker".
Is there a way to avoid caching external resources?

@tgerulaitis
Copy link
Member

Hi @rafaelpatro,

Unfortunately, there isn't a built in way to do this, though it's a good feature request!

You could modify the serviceworker.js file to customise its behaviour for static files. Something like this on line 125 should work:

if (!request.url.startswith('https://your-internal-origin.domain/') {
    return;
}

Hope that helps!

Tomas

@rafaelpatro
Copy link
Author

It helps! Ty

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

No branches or pull requests

2 participants