@swell/apps-sdk 1.0.166 → 1.0.168
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/dist/index.cjs +47 -39
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +47 -39
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +47 -39
- package/dist/index.mjs.map +2 -2
- package/dist/src/cache/html-cache/html-cache.d.ts +9 -1
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ export interface PathRule {
|
|
|
12
12
|
ttl?: number;
|
|
13
13
|
swr?: number;
|
|
14
14
|
skip?: boolean;
|
|
15
|
+
contentTypes?: string[];
|
|
15
16
|
}
|
|
16
17
|
export interface CacheRules {
|
|
17
18
|
defaults?: {
|
|
@@ -64,7 +65,7 @@ export declare class HtmlCache {
|
|
|
64
65
|
protected generateVersionHash(headers: Headers): string;
|
|
65
66
|
protected extractSwellData(headers: Headers): Record<string, unknown>;
|
|
66
67
|
protected isRequestCacheable(request: Request): boolean;
|
|
67
|
-
protected isResponseCacheable(response: Response): boolean;
|
|
68
|
+
protected isResponseCacheable(response: Response, matchedRule?: PathRule): boolean;
|
|
68
69
|
protected getDeploymentMode(headers: Headers): DeploymentMode;
|
|
69
70
|
protected getTTLForRequest(request: Request): number;
|
|
70
71
|
protected getSWRForRequest(request: Request): number;
|
|
@@ -76,6 +77,13 @@ export declare class HtmlCache {
|
|
|
76
77
|
*/
|
|
77
78
|
protected pathMatches(pattern: string, path: string): boolean;
|
|
78
79
|
protected normalizeHeaders(headers: Headers): Record<string, string>;
|
|
80
|
+
protected resolvePathRule(request: Request): {
|
|
81
|
+
rule?: PathRule;
|
|
82
|
+
mode: 'live' | 'preview';
|
|
83
|
+
effectiveTTL: number;
|
|
84
|
+
effectiveSWR: number;
|
|
85
|
+
skip: boolean;
|
|
86
|
+
};
|
|
79
87
|
protected normalizeSearchParams(searchParams: URLSearchParams): string;
|
|
80
88
|
}
|
|
81
89
|
export {};
|