@bluedynamics/cdk8s-plone 0.3.2 → 0.3.4
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/.jsii +47 -28
- package/API.md +28 -3
- package/lib/config/plone-vinyl-backend-response.vcl +25 -0
- package/lib/config/plone-vinyl-recv-routing-volto.vcl +21 -0
- package/lib/config/plone-vinyl-recv.vcl +18 -0
- package/{examples/volto → lib}/config/varnish.tpl.vcl +1 -1
- package/lib/httpcache.js +1 -1
- package/lib/imports/vinyl.bluedynamics.eu.d.ts +398 -66
- package/lib/imports/vinyl.bluedynamics.eu.js +169 -17
- package/lib/plone.js +1 -1
- package/lib/vinylcache.d.ts +21 -0
- package/lib/vinylcache.js +21 -2
- package/package.json +3 -2
- package/.claude/claude.md +0 -39
- package/.claude/settings.local.json +0 -31
- package/CLAUDE.md +0 -352
- package/docs/superpowers/plans/2026-06-12-configurable-service-spec.md +0 -608
- package/docs/superpowers/specs/2026-06-12-configurable-service-spec-design.md +0 -192
- package/documentation/Makefile +0 -357
- package/documentation/README.md +0 -284
- package/documentation/mx.ini +0 -3
- package/documentation/sources/_static/logo.svg +0 -79
- package/documentation/sources/conf.py +0 -145
- package/documentation/sources/explanation/architecture.md +0 -336
- package/documentation/sources/explanation/cdk8s-workflow.md +0 -66
- package/documentation/sources/explanation/features.md +0 -374
- package/documentation/sources/explanation/index.md +0 -34
- package/documentation/sources/how-to/backup-and-restore.md +0 -107
- package/documentation/sources/how-to/configure-env-and-secrets.md +0 -184
- package/documentation/sources/how-to/configure-ingress-tls.md +0 -108
- package/documentation/sources/how-to/configure-security-context.md +0 -143
- package/documentation/sources/how-to/deploy-blicca.md +0 -334
- package/documentation/sources/how-to/deploy-volto.md +0 -324
- package/documentation/sources/how-to/deploy-with-httpcache.md +0 -224
- package/documentation/sources/how-to/deploy-with-vinyl-cache.md +0 -273
- package/documentation/sources/how-to/enable-prometheus-monitoring.md +0 -122
- package/documentation/sources/how-to/index.md +0 -85
- package/documentation/sources/how-to/scale-and-high-availability.md +0 -122
- package/documentation/sources/how-to/schedule-pods.md +0 -145
- package/documentation/sources/how-to/setup-prerequisites.md +0 -363
- package/documentation/sources/how-to/troubleshooting.md +0 -113
- package/documentation/sources/how-to/upgrade-and-rollout.md +0 -140
- package/documentation/sources/index.md +0 -109
- package/documentation/sources/reference/api/index.md +0 -40
- package/documentation/sources/reference/configuration-options.md +0 -352
- package/documentation/sources/reference/index.md +0 -41
- package/documentation/sources/tutorials/01-quick-start.md +0 -165
- package/documentation/sources/tutorials/index.md +0 -53
- package/examples/blicca/.env.example +0 -20
- package/examples/blicca/README.md +0 -339
- package/examples/blicca/__snapshots__/main.test.ts.snap +0 -1035
- package/examples/blicca/cdk8s.yaml +0 -6
- package/examples/blicca/config/varnish.tpl.vcl +0 -217
- package/examples/blicca/ingress.ts +0 -217
- package/examples/blicca/jest.config.js +0 -11
- package/examples/blicca/main.test.ts +0 -18
- package/examples/blicca/main.ts +0 -101
- package/examples/blicca/package.json +0 -36
- package/examples/blicca/postgres.cloudnativepg.ts +0 -63
- package/examples/blicca/postgres.plain.ts +0 -115
- package/examples/blicca/tsconfig.json +0 -33
- package/examples/volto/.env.example +0 -21
- package/examples/volto/README.md +0 -292
- package/examples/volto/__snapshots__/main.test.ts.snap +0 -1206
- package/examples/volto/cdk8s.yaml +0 -6
- package/examples/volto/ingress.ts +0 -229
- package/examples/volto/jest.config.js +0 -11
- package/examples/volto/main.test.ts +0 -18
- package/examples/volto/main.ts +0 -105
- package/examples/volto/package.json +0 -36
- package/examples/volto/postgres.cloudnativepg.ts +0 -63
- package/examples/volto/postgres.plain.ts +0 -115
- package/examples/volto/tsconfig.json +0 -33
package/.jsii
CHANGED
|
@@ -2385,7 +2385,7 @@
|
|
|
2385
2385
|
},
|
|
2386
2386
|
"locationInModule": {
|
|
2387
2387
|
"filename": "src/vinylcache.ts",
|
|
2388
|
-
"line":
|
|
2388
|
+
"line": 613
|
|
2389
2389
|
},
|
|
2390
2390
|
"parameters": [
|
|
2391
2391
|
{
|
|
@@ -2411,7 +2411,7 @@
|
|
|
2411
2411
|
"kind": "class",
|
|
2412
2412
|
"locationInModule": {
|
|
2413
2413
|
"filename": "src/vinylcache.ts",
|
|
2414
|
-
"line":
|
|
2414
|
+
"line": 603
|
|
2415
2415
|
},
|
|
2416
2416
|
"name": "PloneVinylCache",
|
|
2417
2417
|
"properties": [
|
|
@@ -2424,7 +2424,7 @@
|
|
|
2424
2424
|
"immutable": true,
|
|
2425
2425
|
"locationInModule": {
|
|
2426
2426
|
"filename": "src/vinylcache.ts",
|
|
2427
|
-
"line":
|
|
2427
|
+
"line": 840
|
|
2428
2428
|
},
|
|
2429
2429
|
"name": "invalidationUrl",
|
|
2430
2430
|
"type": {
|
|
@@ -2440,7 +2440,7 @@
|
|
|
2440
2440
|
"immutable": true,
|
|
2441
2441
|
"locationInModule": {
|
|
2442
2442
|
"filename": "src/vinylcache.ts",
|
|
2443
|
-
"line":
|
|
2443
|
+
"line": 608
|
|
2444
2444
|
},
|
|
2445
2445
|
"name": "vinylCacheServiceName",
|
|
2446
2446
|
"type": {
|
|
@@ -2573,7 +2573,7 @@
|
|
|
2573
2573
|
"immutable": true,
|
|
2574
2574
|
"locationInModule": {
|
|
2575
2575
|
"filename": "src/vinylcache.ts",
|
|
2576
|
-
"line":
|
|
2576
|
+
"line": 447
|
|
2577
2577
|
},
|
|
2578
2578
|
"name": "image",
|
|
2579
2579
|
"optional": true,
|
|
@@ -2591,7 +2591,7 @@
|
|
|
2591
2591
|
"immutable": true,
|
|
2592
2592
|
"locationInModule": {
|
|
2593
2593
|
"filename": "src/vinylcache.ts",
|
|
2594
|
-
"line":
|
|
2594
|
+
"line": 419
|
|
2595
2595
|
},
|
|
2596
2596
|
"name": "invalidation",
|
|
2597
2597
|
"optional": true,
|
|
@@ -2646,7 +2646,7 @@
|
|
|
2646
2646
|
"immutable": true,
|
|
2647
2647
|
"locationInModule": {
|
|
2648
2648
|
"filename": "src/vinylcache.ts",
|
|
2649
|
-
"line":
|
|
2649
|
+
"line": 440
|
|
2650
2650
|
},
|
|
2651
2651
|
"name": "monitoring",
|
|
2652
2652
|
"optional": true,
|
|
@@ -2665,7 +2665,7 @@
|
|
|
2665
2665
|
"immutable": true,
|
|
2666
2666
|
"locationInModule": {
|
|
2667
2667
|
"filename": "src/vinylcache.ts",
|
|
2668
|
-
"line":
|
|
2668
|
+
"line": 460
|
|
2669
2669
|
},
|
|
2670
2670
|
"name": "nodeSelector",
|
|
2671
2671
|
"optional": true,
|
|
@@ -2725,7 +2725,7 @@
|
|
|
2725
2725
|
"immutable": true,
|
|
2726
2726
|
"locationInModule": {
|
|
2727
2727
|
"filename": "src/vinylcache.ts",
|
|
2728
|
-
"line":
|
|
2728
|
+
"line": 432
|
|
2729
2729
|
},
|
|
2730
2730
|
"name": "purgeHosts",
|
|
2731
2731
|
"optional": true,
|
|
@@ -2903,7 +2903,7 @@
|
|
|
2903
2903
|
"immutable": true,
|
|
2904
2904
|
"locationInModule": {
|
|
2905
2905
|
"filename": "src/vinylcache.ts",
|
|
2906
|
-
"line":
|
|
2906
|
+
"line": 453
|
|
2907
2907
|
},
|
|
2908
2908
|
"name": "tolerations",
|
|
2909
2909
|
"optional": true,
|
|
@@ -2967,7 +2967,7 @@
|
|
|
2967
2967
|
"immutable": true,
|
|
2968
2968
|
"locationInModule": {
|
|
2969
2969
|
"filename": "src/vinylcache.ts",
|
|
2970
|
-
"line":
|
|
2970
|
+
"line": 532
|
|
2971
2971
|
},
|
|
2972
2972
|
"name": "vclBackendErrorSnippet",
|
|
2973
2973
|
"optional": true,
|
|
@@ -2985,7 +2985,7 @@
|
|
|
2985
2985
|
"immutable": true,
|
|
2986
2986
|
"locationInModule": {
|
|
2987
2987
|
"filename": "src/vinylcache.ts",
|
|
2988
|
-
"line":
|
|
2988
|
+
"line": 526
|
|
2989
2989
|
},
|
|
2990
2990
|
"name": "vclBackendFetchSnippet",
|
|
2991
2991
|
"optional": true,
|
|
@@ -3004,7 +3004,7 @@
|
|
|
3004
3004
|
"immutable": true,
|
|
3005
3005
|
"locationInModule": {
|
|
3006
3006
|
"filename": "src/vinylcache.ts",
|
|
3007
|
-
"line":
|
|
3007
|
+
"line": 413
|
|
3008
3008
|
},
|
|
3009
3009
|
"name": "vclBackendResponseSnippet",
|
|
3010
3010
|
"optional": true,
|
|
@@ -3022,7 +3022,7 @@
|
|
|
3022
3022
|
"immutable": true,
|
|
3023
3023
|
"locationInModule": {
|
|
3024
3024
|
"filename": "src/vinylcache.ts",
|
|
3025
|
-
"line":
|
|
3025
|
+
"line": 466
|
|
3026
3026
|
},
|
|
3027
3027
|
"name": "vclDeliverSnippet",
|
|
3028
3028
|
"optional": true,
|
|
@@ -3040,7 +3040,7 @@
|
|
|
3040
3040
|
"immutable": true,
|
|
3041
3041
|
"locationInModule": {
|
|
3042
3042
|
"filename": "src/vinylcache.ts",
|
|
3043
|
-
"line":
|
|
3043
|
+
"line": 520
|
|
3044
3044
|
},
|
|
3045
3045
|
"name": "vclFiniSnippet",
|
|
3046
3046
|
"optional": true,
|
|
@@ -3058,7 +3058,7 @@
|
|
|
3058
3058
|
"immutable": true,
|
|
3059
3059
|
"locationInModule": {
|
|
3060
3060
|
"filename": "src/vinylcache.ts",
|
|
3061
|
-
"line":
|
|
3061
|
+
"line": 508
|
|
3062
3062
|
},
|
|
3063
3063
|
"name": "vclHashSnippet",
|
|
3064
3064
|
"optional": true,
|
|
@@ -3076,7 +3076,7 @@
|
|
|
3076
3076
|
"immutable": true,
|
|
3077
3077
|
"locationInModule": {
|
|
3078
3078
|
"filename": "src/vinylcache.ts",
|
|
3079
|
-
"line":
|
|
3079
|
+
"line": 472
|
|
3080
3080
|
},
|
|
3081
3081
|
"name": "vclHitSnippet",
|
|
3082
3082
|
"optional": true,
|
|
@@ -3094,7 +3094,7 @@
|
|
|
3094
3094
|
"immutable": true,
|
|
3095
3095
|
"locationInModule": {
|
|
3096
3096
|
"filename": "src/vinylcache.ts",
|
|
3097
|
-
"line":
|
|
3097
|
+
"line": 514
|
|
3098
3098
|
},
|
|
3099
3099
|
"name": "vclInitSnippet",
|
|
3100
3100
|
"optional": true,
|
|
@@ -3112,7 +3112,7 @@
|
|
|
3112
3112
|
"immutable": true,
|
|
3113
3113
|
"locationInModule": {
|
|
3114
3114
|
"filename": "src/vinylcache.ts",
|
|
3115
|
-
"line":
|
|
3115
|
+
"line": 478
|
|
3116
3116
|
},
|
|
3117
3117
|
"name": "vclMissSnippet",
|
|
3118
3118
|
"optional": true,
|
|
@@ -3130,7 +3130,7 @@
|
|
|
3130
3130
|
"immutable": true,
|
|
3131
3131
|
"locationInModule": {
|
|
3132
3132
|
"filename": "src/vinylcache.ts",
|
|
3133
|
-
"line":
|
|
3133
|
+
"line": 484
|
|
3134
3134
|
},
|
|
3135
3135
|
"name": "vclPassSnippet",
|
|
3136
3136
|
"optional": true,
|
|
@@ -3148,7 +3148,7 @@
|
|
|
3148
3148
|
"immutable": true,
|
|
3149
3149
|
"locationInModule": {
|
|
3150
3150
|
"filename": "src/vinylcache.ts",
|
|
3151
|
-
"line":
|
|
3151
|
+
"line": 490
|
|
3152
3152
|
},
|
|
3153
3153
|
"name": "vclPipeSnippet",
|
|
3154
3154
|
"optional": true,
|
|
@@ -3166,7 +3166,7 @@
|
|
|
3166
3166
|
"immutable": true,
|
|
3167
3167
|
"locationInModule": {
|
|
3168
3168
|
"filename": "src/vinylcache.ts",
|
|
3169
|
-
"line":
|
|
3169
|
+
"line": 502
|
|
3170
3170
|
},
|
|
3171
3171
|
"name": "vclPurgeSnippet",
|
|
3172
3172
|
"optional": true,
|
|
@@ -3174,18 +3174,37 @@
|
|
|
3174
3174
|
"primitive": "string"
|
|
3175
3175
|
}
|
|
3176
3176
|
},
|
|
3177
|
+
{
|
|
3178
|
+
"abstract": true,
|
|
3179
|
+
"docs": {
|
|
3180
|
+
"default": "- for the Volto variant without a custom `vclRecvSnippet`: the\nbuilt-in plone-vinyl-recv-routing-volto.vcl, which sends `/++api++` and\nblob URLs to `plone_backend` with a VirtualHostMonster rewrite for\n`plone.siteId` and everything else to `plone_frontend`. Otherwise none.",
|
|
3181
|
+
"remarks": "cloud-vinyl runs it for every request method except PURGE and BAN, before\nits GET/HEAD check, so set the backend and rewrite URLs here.\nAddress a backend through its director as `<name>.backend(by=URL)`,\ne.g. `plone_backend.backend(by=URL)`: backends without their own director\nare shard directors in cloud-vinyl.\n\nRequires the operator and CRD of cloud-vinyl 1.2.0 or later. An older CRD\ndrops the field without an error.",
|
|
3182
|
+
"stability": "stable",
|
|
3183
|
+
"summary": "VCL snippet for routing in vcl_recv (`spec.vcl.snippets.vclRecvRouting`)."
|
|
3184
|
+
},
|
|
3185
|
+
"immutable": true,
|
|
3186
|
+
"locationInModule": {
|
|
3187
|
+
"filename": "src/vinylcache.ts",
|
|
3188
|
+
"line": 406
|
|
3189
|
+
},
|
|
3190
|
+
"name": "vclRecvRoutingSnippet",
|
|
3191
|
+
"optional": true,
|
|
3192
|
+
"type": {
|
|
3193
|
+
"primitive": "string"
|
|
3194
|
+
}
|
|
3195
|
+
},
|
|
3177
3196
|
{
|
|
3178
3197
|
"abstract": true,
|
|
3179
3198
|
"docs": {
|
|
3180
3199
|
"default": "- uses built-in plone-vinyl-recv.vcl",
|
|
3181
|
-
"remarks": "
|
|
3200
|
+
"remarks": "cloud-vinyl runs it for GET and HEAD only. Route requests in\n`vclRecvRoutingSnippet` instead, otherwise POST, PUT, PATCH, DELETE and\nOPTIONS go to the first backend without your rewrites.",
|
|
3182
3201
|
"stability": "stable",
|
|
3183
|
-
"summary": "Custom VCL snippet for vcl_recv subroutine."
|
|
3202
|
+
"summary": "Custom VCL snippet for vcl_recv subroutine. Replaces the default Plone recv snippet."
|
|
3184
3203
|
},
|
|
3185
3204
|
"immutable": true,
|
|
3186
3205
|
"locationInModule": {
|
|
3187
3206
|
"filename": "src/vinylcache.ts",
|
|
3188
|
-
"line":
|
|
3207
|
+
"line": 388
|
|
3189
3208
|
},
|
|
3190
3209
|
"name": "vclRecvSnippet",
|
|
3191
3210
|
"optional": true,
|
|
@@ -3203,7 +3222,7 @@
|
|
|
3203
3222
|
"immutable": true,
|
|
3204
3223
|
"locationInModule": {
|
|
3205
3224
|
"filename": "src/vinylcache.ts",
|
|
3206
|
-
"line":
|
|
3225
|
+
"line": 496
|
|
3207
3226
|
},
|
|
3208
3227
|
"name": "vclSynthSnippet",
|
|
3209
3228
|
"optional": true,
|
|
@@ -3783,6 +3802,6 @@
|
|
|
3783
3802
|
"symbolId": "src/vinylcache:VinylCacheTracing"
|
|
3784
3803
|
}
|
|
3785
3804
|
},
|
|
3786
|
-
"version": "0.3.
|
|
3787
|
-
"fingerprint": "
|
|
3805
|
+
"version": "0.3.4",
|
|
3806
|
+
"fingerprint": "4k58oBhT6zKpF8LUEwJMIk/uPzREvJ7JkfpG+Vg7kbY="
|
|
3788
3807
|
}
|
package/API.md
CHANGED
|
@@ -2338,7 +2338,8 @@ const ploneVinylCacheOptions: PloneVinylCacheOptions = { ... }
|
|
|
2338
2338
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclPassSnippet">vclPassSnippet</a></code> | <code>string</code> | Custom VCL snippet for vcl_pass subroutine. |
|
|
2339
2339
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclPipeSnippet">vclPipeSnippet</a></code> | <code>string</code> | Custom VCL snippet for vcl_pipe subroutine. |
|
|
2340
2340
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclPurgeSnippet">vclPurgeSnippet</a></code> | <code>string</code> | Custom VCL snippet for vcl_purge subroutine. |
|
|
2341
|
-
| <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.
|
|
2341
|
+
| <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclRecvRoutingSnippet">vclRecvRoutingSnippet</a></code> | <code>string</code> | VCL snippet for routing in vcl_recv (`spec.vcl.snippets.vclRecvRouting`). |
|
|
2342
|
+
| <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclRecvSnippet">vclRecvSnippet</a></code> | <code>string</code> | Custom VCL snippet for vcl_recv subroutine. Replaces the default Plone recv snippet. |
|
|
2342
2343
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclSynthSnippet">vclSynthSnippet</a></code> | <code>string</code> | Custom VCL snippet for vcl_synth subroutine. |
|
|
2343
2344
|
|
|
2344
2345
|
---
|
|
@@ -2879,6 +2880,28 @@ Custom VCL snippet for vcl_purge subroutine.
|
|
|
2879
2880
|
|
|
2880
2881
|
---
|
|
2881
2882
|
|
|
2883
|
+
##### `vclRecvRoutingSnippet`<sup>Optional</sup> <a name="vclRecvRoutingSnippet" id="@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclRecvRoutingSnippet"></a>
|
|
2884
|
+
|
|
2885
|
+
```typescript
|
|
2886
|
+
public readonly vclRecvRoutingSnippet: string;
|
|
2887
|
+
```
|
|
2888
|
+
|
|
2889
|
+
- *Type:* string
|
|
2890
|
+
- *Default:* for the Volto variant without a custom `vclRecvSnippet`: the built-in plone-vinyl-recv-routing-volto.vcl, which sends `/++api++` and blob URLs to `plone_backend` with a VirtualHostMonster rewrite for `plone.siteId` and everything else to `plone_frontend`. Otherwise none.
|
|
2891
|
+
|
|
2892
|
+
VCL snippet for routing in vcl_recv (`spec.vcl.snippets.vclRecvRouting`).
|
|
2893
|
+
|
|
2894
|
+
cloud-vinyl runs it for every request method except PURGE and BAN, before
|
|
2895
|
+
its GET/HEAD check, so set the backend and rewrite URLs here.
|
|
2896
|
+
Address a backend through its director as `<name>.backend(by=URL)`,
|
|
2897
|
+
e.g. `plone_backend.backend(by=URL)`: backends without their own director
|
|
2898
|
+
are shard directors in cloud-vinyl.
|
|
2899
|
+
|
|
2900
|
+
Requires the operator and CRD of cloud-vinyl 1.2.0 or later. An older CRD
|
|
2901
|
+
drops the field without an error.
|
|
2902
|
+
|
|
2903
|
+
---
|
|
2904
|
+
|
|
2882
2905
|
##### `vclRecvSnippet`<sup>Optional</sup> <a name="vclRecvSnippet" id="@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclRecvSnippet"></a>
|
|
2883
2906
|
|
|
2884
2907
|
```typescript
|
|
@@ -2888,9 +2911,11 @@ public readonly vclRecvSnippet: string;
|
|
|
2888
2911
|
- *Type:* string
|
|
2889
2912
|
- *Default:* uses built-in plone-vinyl-recv.vcl
|
|
2890
2913
|
|
|
2891
|
-
Custom VCL snippet for vcl_recv subroutine.
|
|
2914
|
+
Custom VCL snippet for vcl_recv subroutine. Replaces the default Plone recv snippet.
|
|
2892
2915
|
|
|
2893
|
-
|
|
2916
|
+
cloud-vinyl runs it for GET and HEAD only. Route requests in
|
|
2917
|
+
`vclRecvRoutingSnippet` instead, otherwise POST, PUT, PATCH, DELETE and
|
|
2918
|
+
OPTIONS go to the first backend without your rewrites.
|
|
2894
2919
|
|
|
2895
2920
|
---
|
|
2896
2921
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Plone vcl_backend_response snippet for cloud-vinyl
|
|
2
|
+
# Injected into vcl_backend_response
|
|
3
|
+
|
|
4
|
+
# Remove Set-Cookie from static resources
|
|
5
|
+
if (bereq.url ~ "\.(pdf|asc|dat|txt|doc|xls|ppt|tgz|csv|png|gif|jpeg|jpg|ico|swf|css|js|svg|woff|woff2|ttf|eot)(\?.*)?$") {
|
|
6
|
+
unset beresp.http.Set-Cookie;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
# Don't cache responses with Set-Cookie
|
|
10
|
+
if (beresp.http.Set-Cookie) {
|
|
11
|
+
set beresp.uncacheable = true;
|
|
12
|
+
return (deliver);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
# Don't cache private responses
|
|
16
|
+
if (beresp.http.Cache-Control ~ "private") {
|
|
17
|
+
set beresp.uncacheable = true;
|
|
18
|
+
return (deliver);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
# Default TTL for responses without Cache-Control
|
|
22
|
+
if (!beresp.http.Cache-Control) {
|
|
23
|
+
set beresp.ttl = 30s;
|
|
24
|
+
set beresp.grace = 60s;
|
|
25
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Plone Volto routing snippet for cloud-vinyl (spec.vcl.snippets.vclRecvRouting)
|
|
2
|
+
# Runs in vcl_recv for every method except PURGE and BAN, before cloud-vinyl's
|
|
3
|
+
# GET/HEAD check, so logins, saves and uploads take the same route as reads.
|
|
4
|
+
# PloneVinylCache fills in the site id at synth time.
|
|
5
|
+
# Backends without their own director are shard directors in cloud-vinyl, so
|
|
6
|
+
# they are resolved by URL, like cloud-vinyl's own default backend hint.
|
|
7
|
+
|
|
8
|
+
# The REST API and blobs go to the Plone backend, rewritten for the
|
|
9
|
+
# VirtualHostMonster so that it answers for the site and builds public URLs.
|
|
10
|
+
if (req.url ~ "^/\+\+api\+\+" || req.url ~ "/@@(images|download|display-file)(/|$)") {
|
|
11
|
+
set req.backend_hint = plone_backend.backend(by=URL);
|
|
12
|
+
set req.http.x-vcl-proto = "http";
|
|
13
|
+
if (req.http.X-Forwarded-Proto) {
|
|
14
|
+
set req.http.x-vcl-proto = req.http.X-Forwarded-Proto;
|
|
15
|
+
}
|
|
16
|
+
set req.url = "/VirtualHostBase/" + req.http.x-vcl-proto + "/" + req.http.host + "/__PLONE_SITE_ID__/VirtualHostRoot" + req.url;
|
|
17
|
+
unset req.http.x-vcl-proto;
|
|
18
|
+
} else {
|
|
19
|
+
# Everything else is rendered by Volto.
|
|
20
|
+
set req.backend_hint = plone_frontend.backend(by=URL);
|
|
21
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Plone vcl_recv snippet for cloud-vinyl
|
|
2
|
+
# Injected into vcl_recv for GET and HEAD only, before return(hash).
|
|
3
|
+
# PURGE, BAN and xkey are handled by cloud-vinyl's own VCL before this point.
|
|
4
|
+
|
|
5
|
+
# Detect authenticated requests
|
|
6
|
+
if (req.http.Cookie ~ "__ac" || req.http.Authorization) {
|
|
7
|
+
set req.http.X-Plone-Auth = "true";
|
|
8
|
+
return (pass);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
# Remove tracking cookies to improve cache hit rate
|
|
12
|
+
if (req.http.Cookie) {
|
|
13
|
+
set req.http.Cookie = regsuball(req.http.Cookie, "(^|;\s*)(_ga[^=]*|_gid|_gat|__utm[a-z]+|_hj[a-z]+|_fbp|_fbc)=[^;]*", "");
|
|
14
|
+
set req.http.Cookie = regsuball(req.http.Cookie, "^;\s*", "");
|
|
15
|
+
if (req.http.Cookie ~ "^\s*$") {
|
|
16
|
+
unset req.http.Cookie;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -117,7 +117,7 @@ sub vcl_recv {
|
|
|
117
117
|
if (req.http.X-Forwarded-Proto) {
|
|
118
118
|
set req.http.x-vcl-proto = req.http.X-Forwarded-Proto;
|
|
119
119
|
}
|
|
120
|
-
set req.url = "/VirtualHostBase/" + req.http.x-vcl-proto + "/" + req.http.host + "/
|
|
120
|
+
set req.url = "/VirtualHostBase/" + req.http.x-vcl-proto + "/" + req.http.host + "/{{ .Env.BACKEND_SITE_ID }}/VirtualHostRoot" + req.url;
|
|
121
121
|
} else {
|
|
122
122
|
set req.http.x-vcl-plone = "Frontend";
|
|
123
123
|
set req.backend_hint = lbPloneFrontend.backend();
|
package/lib/httpcache.js
CHANGED
|
@@ -56,7 +56,7 @@ const constructs_1 = require("constructs");
|
|
|
56
56
|
* });
|
|
57
57
|
*/
|
|
58
58
|
class PloneHttpcache extends constructs_1.Construct {
|
|
59
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@bluedynamics/cdk8s-plone.PloneHttpcache", version: "0.3.
|
|
59
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@bluedynamics/cdk8s-plone.PloneHttpcache", version: "0.3.4" };
|
|
60
60
|
/**
|
|
61
61
|
* Name of the Varnish service created by the Helm chart.
|
|
62
62
|
* Use this to reference the cache service from ingress or other constructs.
|