druxt 0.25.0-dev.20261023021249 → 0.25.0-dev.20261023045951

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 CHANGED
@@ -90,36 +90,9 @@ options list.
90
90
  ## Server cache
91
91
 
92
92
  In production, the server keeps Drupal's responses between requests for as
93
- long as Drupal's `Cache-Control` header allows. It keeps the JSON:API index and
94
- menus, and with `cache.content` every other response Druxt fetches, as
95
- [Caching content](#caching-content) describes. Drupal sets that header
96
- from the page cache maximum age (Administration > Configuration > Development >
97
- Performance). At the default of 0, nothing is kept. A request with an
98
- `Authorization` header or a Drupal session cookie never reads or fills the
99
- cache. The cache is off under `nuxt dev`.
100
-
101
- | Option | Type | Default | Description |
102
- | --------------------- | --------- | ------------------- | ------------------------------------------------------------------- |
103
- | `cache.content` | `boolean` | `false` | Also keep entities, collections, views and route lookups. |
104
- | `cache.maxSize` | `number` | `52428800` (50 MB) | Bytes of responses kept per cache area. The least recently used go. |
105
- | `cache.ttl` | `number` | | Seconds a response may be kept at most. `0` keeps nothing. |
106
- | `cache.secret` | `string` | | Turns on `POST /_druxt/cache/clear`. |
107
- | `cache.sessionCookie` | `string` | `'S?SESS[0-9a-f]+'` | A pattern for the session cookie name, for a proxy that renames it. |
108
-
109
- Clear the cache from the app with `this.$store.dispatch('druxt/clearCache')`,
110
- or from Drupal by sending `POST /_druxt/cache/clear` with the secret in an
111
- `X-Druxt-Secret` header. Each Nuxt process has its own cache, so a site with
112
- several processes clears each one.
113
-
114
- The endpoint is server middleware, so list Druxt, or the module that adds it
115
- such as `druxt-site`, under `modules`. Nuxt runs `buildModules` only while it
116
- builds, so under `nuxt start` the endpoint would answer 404.
117
-
118
- ### Caching content
119
-
120
- `cache.content` extends the cache to every other request Druxt sends Drupal:
121
- entities, collections, views and route lookups. A second visitor to a page
122
- then costs Drupal nothing until the page's lifetime runs out.
93
+ long as Drupal's `Cache-Control` header allows: the JSON:API index and menus,
94
+ and with `cache.content` every other response. Drupal sets that header from
95
+ its page cache maximum age, so at the default of 0 nothing is kept.
123
96
 
124
97
  ```js
125
98
  // nuxt.config.js
@@ -130,35 +103,46 @@ export default {
130
103
  };
131
104
  ```
132
105
 
133
- Content changes far more often than menus, so pair it with a clear from
134
- Drupal, below. Without one, an edit reaches anonymous visitors only once the
135
- page cache maximum age has passed. Only successful responses are kept, so a
136
- page published after a visitor saw a 404 appears straight away. A
137
- `bypassCache` dispatch to the Druxt store also skips this cache and stores the
138
- fresh response.
139
-
140
- `cache.maxSize` counts the bytes of the stored JSON, and it applies to each
141
- cache area and consumer. A full cache can take about three times that in server
142
- memory, so size it against the memory each Nuxt process has. A response larger
143
- than the whole limit is not kept.
106
+ | Option | Type | Default | Description |
107
+ | --------------------- | --------- | ------------------- | -------------------------------------------------------------------------------- |
108
+ | `cache.content` | `boolean` | `false` | Also keep entities, collections, views and route lookups. |
109
+ | `cache.maxSize` | `number` | `52428800` (50 MB) | Bytes of responses kept per cache area and consumer. The least recently used go. |
110
+ | `cache.ttl` | `number` | | Seconds a response may be kept at most. `0` keeps nothing. |
111
+ | `cache.secret` | `string` | | Turns on `POST /_druxt/cache/clear`. |
112
+ | `cache.sessionCookie` | `string` | `'S?SESS[0-9a-f]+'` | A pattern for the session cookie name, for a proxy that renames it. |
113
+
114
+ - A request with an `Authorization` header or a Drupal session cookie skips
115
+ the cache, and `nuxt dev` runs without it.
116
+ - Only successful responses are kept. A `bypassCache` dispatch fetches afresh
117
+ and stores the result.
118
+ - A full cache area takes about three times `cache.maxSize` in server memory,
119
+ and a response larger than the limit is not kept.
120
+ - Clear it with `druxt/clearCache`, or from Drupal with
121
+ `POST /_druxt/cache/clear` and the secret in an `X-Druxt-Secret` header.
122
+ Each Nuxt process has its own cache to clear.
123
+ - The clear endpoint is server middleware, so list Druxt, or `druxt-site`,
124
+ under `modules`. Nuxt skips `buildModules` under `nuxt start`.
125
+
126
+ The [caching guide](https://druxtjs.org/how-to/caching) covers the cache in
127
+ more depth.
144
128
 
145
129
  ### Clearing from Drupal with Purge
146
130
 
147
- The [Purge](https://www.drupal.org/project/purge) module can send that request
148
- whenever content changes. Enable `purge`, `purge_purger_http`,
149
- `purge_queuer_coretags` and a processor such as `purge_processor_lateruntime`,
150
- then add the bundled HTTP purger:
131
+ With `cache.content` on, an edit can take up to the page cache maximum age, or
132
+ `cache.ttl` if that is shorter, to reach anonymous visitors, unless Drupal
133
+ clears the cache. The
134
+ [Purge](https://www.drupal.org/project/purge) module can send that request on
135
+ every save. Enable `purge`, `purge_purger_http`, `purge_queuer_coretags` and
136
+ `purge_processor_lateruntime`, then add the bundled HTTP purger:
151
137
 
152
138
  ```sh
153
139
  drush p:purger-add httpbundled
154
140
  ```
155
141
 
156
- Give it the method `POST`, the Nuxt host and port, the path
157
- `/_druxt/cache/clear`, a header `X-Druxt-Secret` with the secret, and the
158
- invalidation type `tag`. One save then costs one request, whatever it
159
- invalidates, and a request refused for a wrong secret is sent again with the
160
- next batch. Keep the secret out of exported configuration: set it from
161
- `settings.php` as a `$config` override.
142
+ Point it at the Nuxt server's host and port, as Drupal reaches it, with the
143
+ path `/_druxt/cache/clear`, the method `POST`, the `X-Druxt-Secret` header and
144
+ the invalidation type `tag`. Set the secret from `settings.php` as
145
+ a `$config` override, not in exported configuration.
162
146
 
163
147
  ## DruxtClient
164
148
 
package/dist/druxt.esm.js CHANGED
@@ -553,7 +553,7 @@ const cacheClearHandler = (secret) => (req, res) => {
553
553
  };
554
554
 
555
555
  var name = "druxt";
556
- var version = "0.25.0-dev.20261023021249";
556
+ var version = "0.25.0-dev.20261023045951";
557
557
  var description = "The Fully Decoupled Drupal Framework for Nuxt.js.";
558
558
  var keywords = [
559
559
  "cms",
@@ -614,7 +614,7 @@ var dependencies = {
614
614
  };
615
615
  var devDependencies = {
616
616
  "@storybook/addon-docs": "^6.5.16",
617
- "druxt-test-utils": "0.2.16-dev.20261023021249"
617
+ "druxt-test-utils": "0.2.16-dev.20261023045951"
618
618
  };
619
619
  var peerDependencies = {
620
620
  axios: ">=0.34.0",
package/dist/druxt.ssr.js CHANGED
@@ -566,7 +566,7 @@ const cacheClearHandler = (secret) => (req, res) => {
566
566
  };
567
567
 
568
568
  var name = "druxt";
569
- var version = "0.25.0-dev.20261023021249";
569
+ var version = "0.25.0-dev.20261023045951";
570
570
  var description = "The Fully Decoupled Drupal Framework for Nuxt.js.";
571
571
  var keywords = [
572
572
  "cms",
@@ -627,7 +627,7 @@ var dependencies = {
627
627
  };
628
628
  var devDependencies = {
629
629
  "@storybook/addon-docs": "^6.5.16",
630
- "druxt-test-utils": "0.2.16-dev.20261023021249"
630
+ "druxt-test-utils": "0.2.16-dev.20261023045951"
631
631
  };
632
632
  var peerDependencies = {
633
633
  axios: ">=0.34.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "druxt",
3
- "version": "0.25.0-dev.20261023021249",
3
+ "version": "0.25.0-dev.20261023045951",
4
4
  "description": "The Fully Decoupled Drupal Framework for Nuxt.js.",
5
5
  "keywords": [
6
6
  "cms",
@@ -61,7 +61,7 @@
61
61
  },
62
62
  "devDependencies": {
63
63
  "@storybook/addon-docs": "^6.5.16",
64
- "druxt-test-utils": "0.2.16-dev.20261023021249"
64
+ "druxt-test-utils": "0.2.16-dev.20261023045951"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "axios": ">=0.34.0",