mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-27 08:13:28 +08:00
not precaching so aggressively
using runtime caching instead using a stale while revalidate strategy caching webfonts with cache first since they will very rarely change
This commit is contained in:
parent
de1009fc07
commit
3667e7630b
1 changed files with 37 additions and 0 deletions
|
@ -87,6 +87,43 @@ const PRODUCTION_CONFIG = {
|
|||
/\.DS_Store/,
|
||||
/\.map$/,
|
||||
/^manifest.*\.js$/,
|
||||
/languages\/.*\.json/,
|
||||
/quotes\/.*\.json/,
|
||||
/themes\/.*\.css/,
|
||||
/challenges\/.*\.txt/,
|
||||
/sound\/.*\.wav/,
|
||||
/images\/.*\.(png|jpg)/,
|
||||
/webfonts\/.+/,
|
||||
],
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: /languages\/.*\.json/,
|
||||
handler: "StaleWhileRevalidate",
|
||||
},
|
||||
{
|
||||
urlPattern: /quotes\/.*\.json/,
|
||||
handler: "StaleWhileRevalidate",
|
||||
},
|
||||
{
|
||||
urlPattern: /themes\/.*\.css/,
|
||||
handler: "StaleWhileRevalidate",
|
||||
},
|
||||
{
|
||||
urlPattern: /challenges\/.*\.txt/,
|
||||
handler: "StaleWhileRevalidate",
|
||||
},
|
||||
{
|
||||
urlPattern: /sound\/.*\.wav/,
|
||||
handler: "StaleWhileRevalidate",
|
||||
},
|
||||
{
|
||||
urlPattern: /images\/.*\.(png|jpg)/,
|
||||
handler: "StaleWhileRevalidate",
|
||||
},
|
||||
{
|
||||
urlPattern: /webfonts\/.+/,
|
||||
handler: "CacheFirst",
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue