Skip to content

Commit

Permalink
vault backup: 2024-06-02 23:31:13
Browse files Browse the repository at this point in the history
Affected files:
content/.obsidian/workspace.json
content/mocs/Data Cache.md
  • Loading branch information
windsuzu committed Jun 2, 2024
1 parent 1835db4 commit 80a6362
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 23 deletions.
51 changes: 32 additions & 19 deletions content/.obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
{
"id": "4954756cba5b7ade",
"type": "tabs",
"dimension": 46.12403100775194,
"dimension": 25.072604065827687,
"children": [
{
"id": "3d50214808998e0a",
Expand Down Expand Up @@ -137,7 +137,7 @@
"repelStrength": 10,
"linkStrength": 1,
"linkDistance": 250,
"scale": 0.38230109687699715,
"scale": 0.27268599173600716,
"close": true
}
}
Expand All @@ -156,7 +156,7 @@
{
"id": "884ddd02c3319b96",
"type": "tabs",
"dimension": 53.875968992248055,
"dimension": 23.039690222652467,
"children": [
{
"id": "57f3938ebda4009b",
Expand Down Expand Up @@ -208,38 +208,51 @@
"file": "mocs/Data Cache.md"
}
}
},
}
]
},
{
"id": "664c38c8bd525c44",
"type": "tabs",
"dimension": 19.36108422071636,
"children": [
{
"id": "d73c6d045a2bcd47",
"id": "94751ef195017213",
"type": "leaf",
"state": {
"type": "backlink",
"type": "outgoing-link",
"state": {
"file": "mocs/Data Cache.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
"showSearch": false,
"searchQuery": "",
"backlinkCollapsed": false,
"linksCollapsed": false,
"unlinkedCollapsed": false
}
}
},
}
]
},
{
"id": "ac5e343256989119",
"type": "tabs",
"dimension": 32.526621490803485,
"children": [
{
"id": "94751ef195017213",
"id": "d73c6d045a2bcd47",
"type": "leaf",
"state": {
"type": "outgoing-link",
"type": "backlink",
"state": {
"file": "mocs/Data Cache.md",
"linksCollapsed": false,
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
"showSearch": false,
"searchQuery": "",
"backlinkCollapsed": false,
"unlinkedCollapsed": false
}
}
}
],
"currentTab": 5
]
}
],
"direction": "horizontal",
Expand All @@ -258,7 +271,7 @@
"cmdr:Obsidian Git: Create backup": false
}
},
"active": "10a82c220b604f75",
"active": "57f3938ebda4009b",
"lastOpenFiles": [
"mocs/Data Cache.md",
"mocs/Request Memoization.md",
Expand Down
8 changes: 4 additions & 4 deletions content/mocs/Data Cache.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
draft: false
date: 2024-06-02 19:33
date: 2024-06-02 23:01
tags:
- react
- nextjs
Expand Down Expand Up @@ -28,11 +28,11 @@ export default async function Page({ params }) {
```

For example, the `guideData` will only be fetched from the API once and stored in the data cache. All users will get the data from the data cache instead of fetching it from the API.
### Revalidation
## Revalidation

This cache is never cleared, even if you redeploy your application. The only way to update the cache is to explicitly tell Next.js to do so using **time-based revalidation** or **on-demand revalidation.**

#### Time-based revalidation
### Time-based revalidation

We can tell Next.js to automatically revalidate the data in the data cache by declaring a time period. You can either declare the time as the second parameter (options) in the `fetch` function, or declare it as a config option of the page.

Expand Down Expand Up @@ -72,7 +72,7 @@ export default async function Page({ params }) {
> [!important]
> The time period declared in the fetch function has higher priority than the one declared in the page when two methods are used at the same time.
#### On-demand Revalidation
### On-demand Revalidation



Expand Down

0 comments on commit 80a6362

Please sign in to comment.