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

cache settings depending on browser #169

Open
maciejtreder opened this issue Jun 20, 2017 · 0 comments
Open

cache settings depending on browser #169

maciejtreder opened this issue Jun 20, 2017 · 0 comments

Comments

@maciejtreder
Copy link

This is feature request, not a bug.

It would be great, if user could specify what kind of data should be fetch for given browser type. It could be specified in ngsw_manifest.json file:

{
  "fetch.rules": [
    { "rule": "image/webp", "browsers": ["chrome"]}, //fetch data only for chrome
    { "rule": "image/png", "browsers": ["safari", "firefox"]}, //fetch data only for safari and firefox
    { "rule": "image/jpg", "browsers": ["^chrome", "^opera"]} //fetch data for every browser which is not chrome or opera
  ]
}

Purpose of this update is that different browsers supports different sets of data. For example, only few browser suppor webp format. At this moment developers can create fallbacks in html and css (more about those here: https://css-tricks.com/using-webp-images/). But there is no fallback for this angular functionality.

Such feature, would be a great opportunity to avoid high origin load when service workes is downloading never-used files

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

1 participant