Skip to content

Instantly share code, notes, and snippets.

View MrPeker's full-sized avatar
🎯
Focusing

Mehmet Ali Peker MrPeker

🎯
Focusing
View GitHub Profile
@MrPeker
MrPeker / cache-google-fonts.js
Created January 27, 2019 17:57
Cache Google Fonts - Webpack
// Google Fonts stil dosyalarını Stale While Revalidate stratejisi ile önbellekleyin
workbox.routing.registerRoute(
/^https:\/\/fonts\.googleapis\.com/,
workbox.strategies.staleWhileRevalidate({
cacheName: 'google-fonts-stylesheets',
}),
);
// Google Fonts webfont dosyalarını Cache First stratejisiyle bir yıllığına önbellekleyin
workbox.routing.registerRoute(