solidstep 0.1.8 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/package.json +1 -1
- package/server.d.ts.map +1 -1
- package/server.js +2 -1
- package/utils/cache.js +1 -1
package/README.md
CHANGED
|
@@ -370,6 +370,10 @@ export const options = {
|
|
|
370
370
|
},
|
|
371
371
|
};
|
|
372
372
|
```
|
|
373
|
+
- Regarding caching, setting `ttl` to `0` or omitting it will disable caching for that page.
|
|
374
|
+
- Setting a positive integer value will cache the page for that duration in milliseconds.
|
|
375
|
+
- Invalidation of cached pages can be done using the `invalidateCache` and `revalidatePath` utilities.
|
|
376
|
+
- The `responseHeaders` option allows you to set custom HTTP headers for the page response.
|
|
373
377
|
|
|
374
378
|
## API Routes
|
|
375
379
|
|
package/package.json
CHANGED
package/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../server.ts"],"names":[],"mappings":"AA0hBA,QAAA,MAAM,OAAO,+FAgVX,CAAC;AAEH,eAAe,OAAO,CAAC"}
|
package/server.js
CHANGED
|
@@ -362,12 +362,13 @@ const render = async ({ toRender, entry, routeParams, searchParams, req, cspNonc
|
|
|
362
362
|
const composed = await compose();
|
|
363
363
|
const rendered = await renderToString(() => composed());
|
|
364
364
|
if (toRender === 'main') {
|
|
365
|
+
const options = cachingOptions;
|
|
365
366
|
setCache(path, {
|
|
366
367
|
rendered: rendered,
|
|
367
368
|
documentMeta: meta,
|
|
368
369
|
documentAssets: assets,
|
|
369
370
|
loaderData: loaderData,
|
|
370
|
-
},
|
|
371
|
+
}, options?.ttl ? options.ttl : 0);
|
|
371
372
|
}
|
|
372
373
|
return {
|
|
373
374
|
rendered: rendered,
|
package/utils/cache.js
CHANGED