Skip to content

Commit

Permalink
fix: cache problem (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
tc-imba committed Jun 25, 2024
1 parent dbfad04 commit 4e2e9ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions example/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
introduction: [
'You can write one or several paragraphs to introduce yourself here. You can find this introduction in the `config.js` file in the template.',
'In this site, almost everything supports Markdown Syntax. For example, you can add hyperlinks in the introduction such as [fxhsb](https://github.com/Reapor-Yurnero) with\n```markdown\n[fxhsb](https://github.com/Reapor-Yurnero)\n```',
'Here we try to test whether reloading is enabled when site updated.',
],
avatar: 'avatar.png',
professions: [
Expand Down
6 changes: 4 additions & 2 deletions gatsby-theme-academic/gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {

export const wrapPageElement = _wrapPageElement;

export function onServiceWorkerUpdateReady() {
window.location.reload(true);
// trigger an immediate page refresh when an update is found
export const onServiceWorkerUpdateReady = () => {
window.location.reload();
console.log('update found, reload the page');
};
1 change: 1 addition & 0 deletions gatsby-theme-academic/gatsby-config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const config = ({
background_color: '#304CFD',
theme_color: '#304CFD',
display: 'standalone',
cache_busting_mode: 'none',
icon, // This path is relative to the root of the site.
legacy: true, // this will add apple-touch-icon links to <head>. Required for
// versions prior to iOS 11.3.
Expand Down

0 comments on commit 4e2e9ce

Please sign in to comment.