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

Commit

Permalink
Merge pull request #4 from diamantdotdev/restyled/beta
Browse files Browse the repository at this point in the history
Restyle 1.3 Release !
  • Loading branch information
HerIsDia authored Jun 25, 2021
2 parents 1d2580a + c56d444 commit e7b24a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# What Pokemon Are You Today !

This little project have just a single utility: telling you what Pokemon you are today !
This little project have just a single utility: telling you what Pokemon you are
today !

<a href="https://github.com/diamantdotdev/What-Pokemon-Are-You-Today/network"><img alt="GitHub forks" src="https://img.shields.io/github/forks/diamantdotdev/What-Pokemon-Are-You-Today?logo=github&style=flat-square"></a>
<a href="https://github.com/diamantdotdev/What-Pokemon-Are-You-Today/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/diamantdotdev/What-Pokemon-Are-You-Today?logo=github&style=flat-square"></a>
Expand Down
23 changes: 11 additions & 12 deletions sw.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import { registerRoute } from 'workbox-routing';
// Used for filtering matches based on status code, header, or both
import { CacheableResponsePlugin } from "workbox-cacheable-response";
// Used to limit entries in cache, remove entries after a certain period of time
import { ExpirationPlugin } from "workbox-expiration";
import { registerRoute } from "workbox-routing";
import {
CacheFirst,
NetworkFirst,
StaleWhileRevalidate,
CacheFirst,
} from 'workbox-strategies';

// Used for filtering matches based on status code, header, or both
import { CacheableResponsePlugin } from 'workbox-cacheable-response';
// Used to limit entries in cache, remove entries after a certain period of time
import { ExpirationPlugin } from 'workbox-expiration';
} from "workbox-strategies";

// Cache page navigations (html) with a Network First strategy
registerRoute(
// Check to see if the request is a navigation to a new page
({ request }) => request.mode === 'navigate',
({ request }) => request.mode === "navigate",
// Use a Network First caching strategy
new NetworkFirst({
// Put all cached files in a cache named 'pages'
cacheName: 'pages',
cacheName: "pages",
plugins: [
// Ensure that only requests that result in a 200 status are cached
new CacheableResponsePlugin({
Expand All @@ -30,11 +29,11 @@ registerRoute(
// Cache images with a Cache First strategy
registerRoute(
// Check to see if the request's destination is style for an image
({ request }) => request.destination === 'image',
({ request }) => request.destination === "image",
// Use a Cache First caching strategy
new CacheFirst({
// Put all cached files in a cache named 'images'
cacheName: 'images',
cacheName: "images",
plugins: [
// Ensure that only requests that result in a 200 status are cached
new CacheableResponsePlugin({
Expand Down

0 comments on commit e7b24a1

Please sign in to comment.