web/assets/js/data/swcache.js

65 lines
1.7 KiB
JavaScript
Raw Normal View History

2020-05-09 19:28:18 +03:00
---
layout: compress
2020-05-09 19:28:18 +03:00
# The list to be cached by PWA
---
2021-04-10 09:51:04 +03:00
const resource = [
2020-05-09 19:28:18 +03:00
2021-04-10 09:51:04 +03:00
/* --- CSS --- */
2021-01-23 10:07:18 +03:00
'{{ "/assets/css/style.css" | relative_url }}',
2020-05-09 19:28:18 +03:00
2021-04-10 09:51:04 +03:00
/* --- JavaScripts --- */
{% assign js_path = "/assets/js" | relative_url %}
'{{ js_path }}/dist/home.min.js',
'{{ js_path }}/dist/page.min.js',
'{{ js_path }}/dist/post.min.js',
'{{ js_path }}/dist/categories.min.js',
'{{ js_path }}/data/search.json',
'{{ "/app.js" | relative_url }}',
'{{ "/sw.js" | relative_url }}',
2020-05-09 19:28:18 +03:00
/* --- HTML --- */
'{{ "/index.html" | relative_url }}',
'{{ "/404.html" | relative_url }}',
2020-12-11 18:08:57 +03:00
{% for tab in site.tabs %}
2021-04-19 10:21:31 +03:00
'{{ tab.url | relative_url }}',
2020-05-09 19:28:18 +03:00
{% endfor %}
2021-04-29 14:50:23 +03:00
/* --- Favicons --- */
{% assign favicon_path = "/assets/img/favicons" | relative_url %}
'{{ favicon_path }}/android-chrome-192x192.png',
'{{ favicon_path }}/android-chrome-512x512.png',
'{{ favicon_path }}/apple-touch-icon.png',
'{{ favicon_path }}/favicon-16x16.png',
'{{ favicon_path }}/favicon-32x32.png',
'{{ favicon_path }}/favicon.ico',
'{{ favicon_path }}/mstile-150x150.png',
'{{ favicon_path }}/site.webmanifest',
'{{ favicon_path }}/browserconfig.xml'
2020-05-09 19:28:18 +03:00
];
2020-05-11 20:01:12 +03:00
2021-04-10 09:51:04 +03:00
/* The request url with below domain will be cached */
const allowedDomains = [
{% if site.google_analytics.id != empty and site.google_analytics.id %}
2021-04-10 09:51:04 +03:00
'www.googletagmanager.com',
'www.google-analytics.com',
{% endif %}
'{{ site.url | split: "//" | last }}',
'fonts.gstatic.com',
'fonts.googleapis.com',
'cdn.jsdelivr.net',
'polyfill.io'
];
/* Requests that include the following path will be banned */
const denyUrls = [
{% if site.google_analytics.pv.cache_path %}
'{{ site.google_analytics.pv.cache_path | absolute_url }}'
{% endif %}
2020-05-11 20:01:12 +03:00
];