2020-05-09 19:28:18 +03:00
|
|
|
---
|
2020-05-29 19:48:10 +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 = [
|
2023-09-10 16:45:27 +03:00
|
|
|
/* --- CSS --- */
|
|
|
|
'{{ "/assets/css/style.css" | relative_url }}',
|
|
|
|
|
|
|
|
/* --- PWA --- */
|
|
|
|
'{{ "/app.js" | relative_url }}',
|
|
|
|
'{{ "/sw.js" | relative_url }}',
|
|
|
|
|
|
|
|
/* --- HTML --- */
|
|
|
|
'{{ "/index.html" | relative_url }}',
|
|
|
|
'{{ "/404.html" | relative_url }}',
|
|
|
|
|
|
|
|
{% for tab in site.tabs %}
|
|
|
|
'{{ tab.url | relative_url }}',
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
/* --- Favicons & compressed JS --- */
|
|
|
|
{% assign cache_list = site.static_files | where: 'swcache', true %}
|
|
|
|
{% for file in cache_list %}
|
|
|
|
'{{ file.path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
|
|
|
|
{% endfor %}
|
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 = [
|
2023-09-10 16:45:27 +03:00
|
|
|
{% if site.google_analytics.id != empty and site.google_analytics.id %}
|
|
|
|
'www.googletagmanager.com',
|
|
|
|
'www.google-analytics.com',
|
|
|
|
{% endif %}
|
2021-04-10 09:51:04 +03:00
|
|
|
|
2023-09-10 16:45:27 +03:00
|
|
|
'{{ site.url | split: "//" | last }}',
|
2021-04-10 09:51:04 +03:00
|
|
|
|
2023-09-10 16:45:27 +03:00
|
|
|
{% if site.img_cdn contains '//' and site.img_cdn %}
|
|
|
|
'{{ site.img_cdn | split: '//' | last | split: '/' | first }}',
|
|
|
|
{% endif %}
|
2022-02-02 20:31:53 +03:00
|
|
|
|
2023-09-10 16:45:27 +03:00
|
|
|
'fonts.gstatic.com',
|
|
|
|
'fonts.googleapis.com',
|
|
|
|
'cdn.jsdelivr.net',
|
|
|
|
'polyfill.io'
|
2021-04-10 09:51:04 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
/* Requests that include the following path will be banned */
|
2023-06-04 05:56:31 +03:00
|
|
|
const denyUrls = [];
|