@quintype/framework 7.30.4 → 7.30.6
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/CHANGELOG.md +9 -0
- package/package.json +2 -2
- package/server/amp/handlers/story-page.js +14 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [7.30.6](https://github.com/quintype/quintype-node-framework/compare/v7.30.5...v7.30.6) (2024-10-30)
|
|
6
|
+
|
|
7
|
+
### [7.30.5](https://github.com/quintype/quintype-node-framework/compare/v7.30.4...v7.30.5) (2024-10-22)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **cache-tags:** fix amp cache tags ([#443](https://github.com/quintype/quintype-node-framework/issues/443)) ([009bbca](https://github.com/quintype/quintype-node-framework/commit/009bbcab7d42e70626d541ca80def10625ca021e))
|
|
13
|
+
|
|
5
14
|
### [7.30.4](https://github.com/quintype/quintype-node-framework/compare/v7.30.3...v7.30.4) (2024-10-22)
|
|
6
15
|
|
|
7
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quintype/framework",
|
|
3
|
-
"version": "7.30.
|
|
3
|
+
"version": "7.30.6",
|
|
4
4
|
"description": "Libraries to help build Quintype Node.js apps",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"engines": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"homepage": "https://github.com/quintype/quintype-node-framework#readme",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@ampproject/toolbox-optimizer": "2.8.3",
|
|
34
|
-
"@quintype/amp": "^2.
|
|
34
|
+
"@quintype/amp": "^2.20.0",
|
|
35
35
|
"@quintype/backend": "2.5.1",
|
|
36
36
|
"@quintype/components": "^3.5.0",
|
|
37
37
|
"@quintype/prerender-node": "^3.2.26",
|
|
@@ -153,14 +153,26 @@ async function ampStoryPageHandler(
|
|
|
153
153
|
if (ampHtml instanceof Error) return next(ampHtml);
|
|
154
154
|
|
|
155
155
|
res.set("Content-Type", "text/html");
|
|
156
|
+
|
|
157
|
+
const pageCacheKey = `page/${config["publisher-id"]}/story-page`;
|
|
158
|
+
let cacheKeys = [storyToCacheKey(config["publisher-id"], story), pageCacheKey];
|
|
159
|
+
|
|
160
|
+
/* To cdn purge amp stories through custom tags, use getAdditionalCacheKeys function
|
|
161
|
+
to generate one or more cache tags, it should return cache tags as an array of strings. */
|
|
162
|
+
const getAdditionalCacheKeys = get(opts, ["featureConfig", "getAdditionalCacheKeys"]);
|
|
163
|
+
if (getAdditionalCacheKeys) {
|
|
164
|
+
const additionalCacheKeys = getAdditionalCacheKeys(config);
|
|
165
|
+
cacheKeys = cacheKeys.concat(additionalCacheKeys);
|
|
166
|
+
}
|
|
167
|
+
|
|
156
168
|
addCacheHeadersToResult({
|
|
157
169
|
res,
|
|
158
|
-
cacheKeys
|
|
170
|
+
cacheKeys,
|
|
159
171
|
cdnProvider,
|
|
160
172
|
config,
|
|
173
|
+
sMaxAge: "86400",
|
|
161
174
|
});
|
|
162
175
|
|
|
163
|
-
|
|
164
176
|
const finalResponse = optimizeAmpHtml ? await optimize(ampHtml) : ampHtml;
|
|
165
177
|
|
|
166
178
|
return res.send(finalResponse);
|