Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion rootfs/etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ server {

root /usr/share/nginx/html;
index index.html index.html;


location ~* ^/(images|symbols|ogv)(/.*)*\.(svg|png|jpe?g|gif|webp|ico|js|css|woff2?)$ {
add_header Cache-Control "public, max-age=31536000, immutable" always;
access_log off;
log_not_found off;
}

try_files $uri $uri/ /index.html;

set $auth_basic off;
Expand Down
17 changes: 14 additions & 3 deletions sw-precache-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,21 @@ module.exports = {
staticFileGlobs: [
'build/*.html',
'build/manifest.json',
'build/static/**/!(*map*)',
'build/static/**/*.*',
...boardImages
],
maximumFileSizeToCacheInBytes: 4194304,
runtimeCaching: [
{
urlPattern: /\/static\//,
handler: 'cacheFirst',
options: {
cache: {
name: 'static-assets',
maxEntries: 200
}
}
},
{
urlPattern: /\/symbols\/mulberry/,
handler: 'cacheFirst',
Expand Down Expand Up @@ -62,10 +72,11 @@ module.exports = {
}
}
],
dontCacheBustUrlsMatching: /\.\w{8}\./,
navigateFallback: '/index.html',
navigateFallbackWhitelist: [/^\/(?!api).*/],
dontCacheBustUrlsMatching: /\.(js|css|json|jpg|jpeg|png|svg|ico)$/,
dynamicUrlToDependencies: {
'/': ['build/index.html']
},
navigateFallback: '/',
swFilePath: 'build/service-worker.js'
};
Loading