Skip to content

Commit 2739065

Browse files
committed
docs: Add optional loader option refreshIntervalDays
1 parent 28ec546 commit 2739065

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,13 @@ npm add astro-loader-goodreads
6565

6666
### Loader Options
6767

68-
| Property | Description | Required |
69-
| --------------------- | ----------------------------------------- | ---------- |
70-
| `url` | The URL of your Goodreads shelf, user, or author. ||
68+
| Property | Description | Required | Default |
69+
| --------------------- | ----------------------------------------- | ---------- | ------- |
70+
| `url` | The URL of your Goodreads shelf, user, or author. || - |
71+
| `refreshIntervalDays` | Number of days to cache data before fetching again from Goodreads. || `0` |
72+
73+
When `refreshIntervalDays` is set (e.g., to `7` for weekly updates), the loader will only fetch new data from Goodreads when that many days have passed since the last fetch.
74+
feat: Add optional loader option `refreshIntervalDays`. If not specified, no caching is done between builds (Astro's default data caching between page loads still applies).
7175

7276
### Defining & Using Astro Content Collections
7377

@@ -101,6 +105,7 @@ import { goodreadsLoader } from "astro-loader-goodreads";
101105
const currentlyReading = defineCollection({
102106
loader: goodreadsLoader({
103107
url: "https://www.goodreads.com/review/list/152185079-sadman-hossain?shelf=currently-reading",
108+
refreshIntervalDays: 7, // optional parameter; set to only fetch new data once per week
104109
}),
105110
});
106111

0 commit comments

Comments
 (0)