-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid caching pageviews data #1849
Avoid caching pageviews data #1849
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous solution (before 8362564) was to filter GA URLs by configuration file data/swcache.js
.
jekyll-theme-chirpy/assets/js/data/swcache.js
Lines 49 to 54 in 728094d
/* 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 %} | |
]; |
Now we can restore this configuration in assets/js/data/swconf.js
f8129fb
to
3d501cc
Compare
I forgot that we used to have pageviews. Thanks for reminding me. I have published changes as suggested. Please let me know what do you think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defining in denyPaths
doesn't seem to fit because it sets relative paths.
We should define a new variable denyUrls
to store these CORS URLs.
Also, _javascript/pwa/sw.js
needs to be modified accordingly.
455b05f
to
0b1f717
Compare
0b1f717
to
5911624
Compare
## [7.1.0](v7.0.1...v7.1.0) (2024-08-27) ### Features * add Bluesky social links ([#1759](#1759)) ([0102aba](0102aba)) * add Reddit social option ([#1836](#1836)) ([8673e13](8673e13)) * add Threads social links ([#1837](#1837)) ([e3a78b6](e3a78b6)) * **analytics:** add fathom analytics ([#1913](#1913)) ([befc4ce](befc4ce)) * **dev:** add vscode tasks ([#1843](#1843)) ([e4db1a1](e4db1a1)) * **dev:** support vscode dev-container ([#1781](#1781)) ([1e3d4a6](1e3d4a6)) * **ui:** improve block quote layout ([80bd792](80bd792)) * **ui:** improve visibility of inline code ([#1831](#1831)) ([c876731](c876731)) * **ui:** make `info-prompt` icon looks like the letter "i" ([#1835](#1835)) ([a07a57e](a07a57e)) * **ui:** set `<kbd>` font to 'Lato' ([64c7262](64c7262)) ### Bug Fixes * adapt the giscus localization parameter ([#1810](#1810)) ([0709854](0709854)) * avoid caching pageviews data ([#1849](#1849)) ([979f86c](979f86c)) * remove extra dual-mode images from lightbox ([#1883](#1883)) ([5c5910f](5c5910f))
🎉 This issue has been resolved in version 7.1.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
## [7.1.0](cotes2020/jekyll-theme-chirpy@v7.0.1...v7.1.0) (2024-08-27) ### Features * add Bluesky social links ([#1759](cotes2020/jekyll-theme-chirpy#1759)) ([6c7d07b](cotes2020/jekyll-theme-chirpy@6c7d07b)) * add Reddit social option ([#1836](cotes2020/jekyll-theme-chirpy#1836)) ([9711f2a](cotes2020/jekyll-theme-chirpy@9711f2a)) * add Threads social links ([#1837](cotes2020/jekyll-theme-chirpy#1837)) ([5e92fea](cotes2020/jekyll-theme-chirpy@5e92fea)) * **analytics:** add fathom analytics ([#1913](cotes2020/jekyll-theme-chirpy#1913)) ([78eda9d](cotes2020/jekyll-theme-chirpy@78eda9d)) * **dev:** add vscode tasks ([#1843](cotes2020/jekyll-theme-chirpy#1843)) ([0a92a68](cotes2020/jekyll-theme-chirpy@0a92a68)) * **dev:** support vscode dev-container ([#1781](cotes2020/jekyll-theme-chirpy#1781)) ([231e700](cotes2020/jekyll-theme-chirpy@231e700)) * **ui:** improve block quote layout ([2f84ff4](cotes2020/jekyll-theme-chirpy@2f84ff4)) * **ui:** improve visibility of inline code ([#1831](cotes2020/jekyll-theme-chirpy#1831)) ([2e81f62](cotes2020/jekyll-theme-chirpy@2e81f62)) * **ui:** make `info-prompt` icon looks like the letter "i" ([#1835](cotes2020/jekyll-theme-chirpy#1835)) ([68ce89d](cotes2020/jekyll-theme-chirpy@68ce89d)) * **ui:** set `<kbd>` font to 'Lato' ([e959570](cotes2020/jekyll-theme-chirpy@e959570)) ### Bug Fixes * adapt the giscus localization parameter ([#1810](cotes2020/jekyll-theme-chirpy#1810)) ([d420c8c](cotes2020/jekyll-theme-chirpy@d420c8c)) * avoid caching pageviews data ([#1849](cotes2020/jekyll-theme-chirpy#1849)) ([a69cf87](cotes2020/jekyll-theme-chirpy@a69cf87)) * remove extra dual-mode images from lightbox ([#1883](cotes2020/jekyll-theme-chirpy#1883)) ([338f926](cotes2020/jekyll-theme-chirpy@338f926))
## [7.1.0](cotes2020/jekyll-theme-chirpy@v7.0.1...v7.1.0) (2024-08-27) ### Features * add Bluesky social links ([cotes2020#1759](cotes2020#1759)) ([0102aba](cotes2020@0102aba)) * add Reddit social option ([cotes2020#1836](cotes2020#1836)) ([8673e13](cotes2020@8673e13)) * add Threads social links ([cotes2020#1837](cotes2020#1837)) ([e3a78b6](cotes2020@e3a78b6)) * **analytics:** add fathom analytics ([cotes2020#1913](cotes2020#1913)) ([befc4ce](cotes2020@befc4ce)) * **dev:** add vscode tasks ([cotes2020#1843](cotes2020#1843)) ([e4db1a1](cotes2020@e4db1a1)) * **dev:** support vscode dev-container ([cotes2020#1781](cotes2020#1781)) ([1e3d4a6](cotes2020@1e3d4a6)) * **ui:** improve block quote layout ([80bd792](cotes2020@80bd792)) * **ui:** improve visibility of inline code ([cotes2020#1831](cotes2020#1831)) ([c876731](cotes2020@c876731)) * **ui:** make `info-prompt` icon looks like the letter "i" ([cotes2020#1835](cotes2020#1835)) ([a07a57e](cotes2020@a07a57e)) * **ui:** set `<kbd>` font to 'Lato' ([64c7262](cotes2020@64c7262)) ### Bug Fixes * adapt the giscus localization parameter ([cotes2020#1810](cotes2020#1810)) ([0709854](cotes2020@0709854)) * avoid caching pageviews data ([cotes2020#1849](cotes2020#1849)) ([979f86c](cotes2020@979f86c)) * remove extra dual-mode images from lightbox ([cotes2020#1883](cotes2020#1883)) ([5c5910f](cotes2020@5c5910f))
Type of change
Description
To retrieve pageviews we send
GET
request from_includes/pageviews/goatcounter.html
. When PWA is enabled, the response is cached and so the pageview counter is not updated as expected.Additional context
I see two possible ways to fix this behavior:
GET
requests uniqueOption 1 is easy fix, applied in this PR but has it's drawbacks e.g. utilize cache.
Option 2 seems preferable. However, it requires changes in
_javascript/pwa/sw.js
to support non-relative paths.Please let me know your thoughts on this.