<commit_before>importScripts('https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js');

const CACHE_NAME = 'workbox:assets';

// Cache all
const REGEXP_ALL = /.*\.(?:js|css|png|jpg|jpeg|svg|gif)/;

// [OK] Stale While Revalidate
workbox.routing.registerRoute(
  REGEXP_ALL,
  workbox.strategies.staleWhileRevalidate({
    cacheName: `${CACHE_NAME}:stale-while-revalidate`,
  }),
);<commit_msg>Update sw.js<commit_after>importScripts('https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js');

const CACHE_NAME = 'workbox:js';

const APP_JS = new RegExp('/static/custom/.*\.js');
const APP_ANGULAR_JS = new RegExp('/static/custom/app/.*\.js');
const VENDOR_JS = new RegExp('/static/vandor/.*\.js');


// [OK] Stale While Revalidate
workbox.routing.registerRoute(
  APP_JS,
  workbox.strategies.staleWhileRevalidate({
    cacheName: `${CACHE_NAME}:stale-while-revalidate`,
  }),
);

// [OK] Stale While Revalidate
workbox.routing.registerRoute(
  APP_ANGULAR_JS,
  workbox.strategies.staleWhileRevalidate({
    cacheName: `${CACHE_NAME}:stale-while-revalidate`,
  }),
);

// [OK] Stale While Revalidate
workbox.routing.registerRoute(
  VENDOR_JS,
  workbox.strategies.staleWhileRevalidate({
    cacheName: `${CACHE_NAME}:stale-while-revalidate`,
  }),
);
{'fraction_non_alphanumeric': 0.17327117327117328, 'fraction_numerical': 0.004662004662004662, 'mean_word_length': 5.018691588785047, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1751517', 'n_tokens_mistral': 501, 'n_tokens_neox': 493, 'n_words': 62}