1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 21:53:26 +00:00

refactor!: optimize the resource hints (#1717)

Improved the data structure for defining resource hints to the browser.
This commit is contained in:
Cotes Chung
2024-05-02 05:11:45 +08:00
committed by GitHub
parent f1c6d2a817
commit dcb0add47b
4 changed files with 28 additions and 64 deletions

View File

@@ -22,20 +22,6 @@ const swconf = {
{% endfor %}
],
{%- comment -%} The request url with below domain will be cached. {%- endcomment -%}
allowHosts: [
{% if site.cdn and site.cdn contains '//' %}
'{{ site.cdn | split: '//' | last | split: '/' | first }}',
{% endif %}
{%- unless site.assets.self_host.enabled -%}
{% for cdn in site.data.origin["cors"].cdns %}
'{{ cdn.url | split: "//" | last }}'
{%- unless forloop.last -%},{%- endunless -%}
{% endfor %}
{% endunless %}
],
{%- comment -%} The request url with below path will not be cached. {%- endcomment -%}
denyPaths: [
{% for path in site.pwa.cache.deny_paths %}