Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make recipes easier to consume #2622

Closed
Snugug opened this issue Aug 28, 2020 · 0 comments · Fixed by #2664
Closed

Make recipes easier to consume #2622

Snugug opened this issue Aug 28, 2020 · 0 comments · Fixed by #2664
Labels
Discuss An open question, where input from the community would be appreciated. New Project Idea Ideas for a new, standalone module.

Comments

@Snugug
Copy link
Contributor

Snugug commented Aug 28, 2020

There are two sets of recipes that Workbox has published, common recipes and advanced recipes, and there are likely other patterns the Workbox community have come up with that are similar. I think it may be useful to provide easy-to-consume versions of these recipes to reduce onboarding friction to Workbox. I could envision something like the following:

Offline Page Only Recipe

import { OfflinePage } from 'workbox-recipes';

new OfflinePage('/offline.html');

Google Fonts and Caching Images Recipes

import { GoogleFontsCache, ImageCache} from 'workbox-recipes';

// Cache the Google Fonts stylesheets with StaleWhileRevalidate and cache the underlying font files for 1 year, max 30 entries
new GoogleFontsCache(30, 60 * 60 * 24 * 365);

// Images would be similar, here max 60 entries for 30 days
new ImageCache(60, 30 * 24 * 60 * 60);

Would love some community feedback here, if this is something worth pursuing and if so, what recipes might we want to prioritize.

@Snugug Snugug added New Project Idea Ideas for a new, standalone module. Discuss An open question, where input from the community would be appreciated. labels Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discuss An open question, where input from the community would be appreciated. New Project Idea Ideas for a new, standalone module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant