Skip to content

Commit d695d92

Browse files
committed
fixes
1 parent adbd9e9 commit d695d92

File tree

3 files changed

+50
-4
lines changed

3 files changed

+50
-4
lines changed

release/app/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "todo-my-app-name",
3-
"version": "1.9.0",
3+
"version": "1.10.0",
44
"description": "Todo my app description",
55
"license": "MIT",
66
"main": "./dist/main/main.js",

src/renderer/app/components/ApiIntegrationComponent/createApiREADME.tsx

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,50 @@ function filtersToJsObjectString(filters: any[], indent: number = defaultIndenta
9090
const formattedString = `{\n` + entries.join('\n') + `\n${bracketsIndentationStr}}`
9191
return formattedString
9292
}
93+
94+
function createCachingText(enable_cache: boolean): string {
95+
if (enable_cache) {
96+
return `## Caching
97+
98+
The API automatically **caches** results to minimize redundant scraping. This means:
99+
- Scraper results are stored based on input data
100+
- Subsequent requests with the same input data return cached data instantly
101+
102+
### Changing Cache Settings
103+
104+
You can change this caching behavior when initializing the API client:
105+
106+
\`\`\`typescript
107+
// Option 1: Disable caching for fresh results
108+
const api = new Api({ enableCache: false })
109+
110+
// Option 2: Keep caching enabled (default)
111+
const api = new Api({ enableCache: true })
112+
\`\`\``;
113+
} else {
114+
return `## Caching
115+
116+
The API does not **cache results**, so you get fresh results on every request.
117+
118+
### Changing Cache Settings
119+
120+
You can change this caching behavior when initializing the API client:
121+
122+
\`\`\`typescript
123+
// Option 1: Enable caching to improve performance
124+
const api = new Api({ enableCache: true })
125+
126+
// Option 2: Keep caching disabled for fresh results (default)
127+
const api = new Api({ enableCache: false })
128+
\`\`\`
129+
130+
When caching is enabled:
131+
- Scraper results are stored based on input data
132+
- Subsequent requests with the same input data return cached data instantly`;
133+
}
134+
135+
}
136+
93137
function createApiTaskText(scraperName: string, hasSingleScraper: boolean, defaultData: any, maxRunsMessage): string {
94138
const x = hasSingleScraper ? '' : `scraperName: '${scraperName}', `
95139

@@ -418,7 +462,7 @@ This will:
418462
- Make a **GET** request to the \`${final[0]}\` endpoint.
419463
- Execute the scraper immediately, bypassing task creation, scheduling, and running overhead.
420464
- Validate input data before execution, returning a \`400\` error for invalid requests.
421-
${enable_cache ? '- Cache the results based on the provided parameters.\n' : ''}- ${maxRunsMessage2}
465+
${enable_cache ? '- Cache the results based on the provided input data.\n' : ''}- ${maxRunsMessage2}
422466
423467
This method is especially useful when:
424468
@@ -482,6 +526,8 @@ async function main() {
482526
main()
483527
\`\`\`
484528
529+
${createCachingText(enable_cache)}
530+
485531
## That's It!
486532
487533
Now, go and build something awesome.`

0 commit comments

Comments
 (0)